Results 1 to 13 of 13

Thread: Get info from a websites source

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2012
    Posts
    157

    Get info from a websites source

    Website source:
    HTML Code:
    Some random content
    <div id="right" class="column">
      <div class="pane">
        <div class="pane_header"><h2>Site News & Events</h2></div>
          <div class="pane_content">
            <div id="news_feed">
              <div class='news_post'>
                <p class="news_post_topic"><a href="/example" title="example</a><br/>
                 Posted <abbr class='timeago' title='2013-05-21 16:28:07'>05/21/2013</abbr></p>
              </div>
              <div class='news_post'>
                <p class="news_post_topic"><a href="/example2" title="examples">/example</a><br/>
                Posted <abbr class='timeago' title='2013-05-10 16:53:37'>05/10/2013</abbr></p>
              </div>
           </div>
        </div>
    .....
    Some more content
    What i want:
    Without any webbrowser window,(using webclient), search in all the code.
    Find the id news_feed, and go to the first child, and get the websitelink, the title, and the date posted.
    Then display the title, with the websitelink on a linklabel, and the dateposted on the label.
    Then do the same foe the next news_post.
    I believed it would look something like this, but i was wrong
    WebBrowser1.Document.GetElementById("news_feed").AppendChild(1) ...[On this example i used webbrowser. I want it without it ]
    < advertising removed by moderator >

  2. #2

    Re: Get info from a websites source

    If you did some Bing/Google searches, you would have probably found the Html Agility Pack which will do exactly what you need.

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Get info from a websites source

    Aaargh! Not the Agility Pack! Anything but the Agility Pack!
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Jun 2012
    Posts
    157

    Re: Get info from a websites source

    Quote Originally Posted by formlesstree4 View Post
    If you did some Bing/Google searches, you would have probably found the Html Agility Pack which will do exactly what you need.
    Thanks alot, i will see what i can do
    < advertising removed by moderator >

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Jun 2012
    Posts
    157

    Re: Get info from a websites source

    Quote Originally Posted by dunfiddlin View Post
    Aaargh! Not the Agility Pack! Anything but the Agility Pack!
    Why not? What should i use? Do you recommend something? Thanks alot for the help
    Kind regards
    < advertising removed by moderator >

  6. #6
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Get info from a websites source

    It's just not necessary. It's simpler (and requires no additives!) to continue using a webbrowser object, just behind the scenes. It's not necessary to make the browser visible or for the user to be in any way aware of it. It's simply a host for the HTML document (which is ultimately all the Agility Pack is, after all!)
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  7. #7

    Re: Get info from a websites source

    Quote Originally Posted by dunfiddlin View Post
    It's just not necessary. It's simpler (and requires no additives!) to continue using a webbrowser object, just behind the scenes. It's not necessary to make the browser visible or for the user to be in any way aware of it. It's simply a host for the HTML document (which is ultimately all the Agility Pack is, after all!)
    His criteria was to not use it!
    Had he not said that, I would have just said use the WebBrowser. Who are we to say to the OP that he should use the phillips head screw driver on a phillips screw when the flat head clearly works

    EDIT: He could EVEN use mshtml and reference the HtmlDocument class there!!

  8. #8
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Get info from a websites source

    His criteria was to not use it!
    You've got to read between the lines sometimes! What he said was not to use it, what I think he meant was not to show that he was using it! Could be wrong. It happens. There was that occasion in 1974 when ...
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  9. #9

    Re: Get info from a websites source

    Quote Originally Posted by dunfiddlin View Post
    You've got to read between the lines sometimes! What he said was not to use it, what I think he meant was not to show that he was using it! Could be wrong. It happens. There was that occasion in 1974 when ...
    formlesstree4 pulls up a chair
    ...go on

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Jun 2012
    Posts
    157

    Re: Get info from a websites source

    Quote Originally Posted by dunfiddlin View Post
    You've got to read between the lines sometimes! What he said was not to use it, what I think he meant was not to show that he was using it! Could be wrong. It happens. There was that occasion in 1974 when ...
    Well i meant, you know how it is this..
    Dim str As String = New WebClient().DownloadString(("http://downforeveryoneorjustme.com/planetminecraft.com"))
    something like that, not a webbrowser, it doesn't use gui.
    But anyways, i need though help with the childs. how to get the correct id, and each child.
    < advertising removed by moderator >

  11. #11

    Re: Get info from a websites source

    Quote Originally Posted by vasil7112 View Post
    Well i meant, you know how it is this..
    Dim str As String = New WebClient().DownloadString(("http://downforeveryoneorjustme.com/planetminecraft.com"))
    something like that, not a webbrowser, it doesn't use gui.
    But anyways, i need though help with the childs. how to get the correct id, and each child.
    You don't even need to SHOW the WebBrowser. You can make an instance of it because, at its heart, it's still an object. So just create a WebBrowser and load it up.

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Jun 2012
    Posts
    157

    Re: Get info from a websites source

    Quote Originally Posted by formlesstree4 View Post
    You don't even need to SHOW the WebBrowser. You can make an instance of it because, at its heart, it's still an object. So just create a WebBrowser and load it up.
    Ok, another question. if instead of id, it was class, how can i do it?
    < advertising removed by moderator >

  13. #13

    Re: Get info from a websites source

    It's amazing what using a search engine will uncover!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width