|
-
May 23rd, 2013, 12:57 PM
#1
Thread Starter
Addicted Member
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 >
-
May 23rd, 2013, 01:08 PM
#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.
-
May 23rd, 2013, 01:15 PM
#3
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!
-
May 23rd, 2013, 01:17 PM
#4
Thread Starter
Addicted Member
Re: Get info from a websites source
 Originally Posted by formlesstree4
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 >
-
May 23rd, 2013, 01:17 PM
#5
Thread Starter
Addicted Member
Re: Get info from a websites source
 Originally Posted by dunfiddlin
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 >
-
May 23rd, 2013, 01:26 PM
#6
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!
-
May 23rd, 2013, 01:30 PM
#7
Re: Get info from a websites source
-
May 23rd, 2013, 01:52 PM
#8
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!
-
May 23rd, 2013, 02:10 PM
#9
Re: Get info from a websites source
 Originally Posted by dunfiddlin
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
-
May 23rd, 2013, 02:12 PM
#10
Thread Starter
Addicted Member
Re: Get info from a websites source
 Originally Posted by dunfiddlin
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 >
-
May 23rd, 2013, 02:47 PM
#11
Re: Get info from a websites source
 Originally Posted by vasil7112
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.
-
May 23rd, 2013, 03:08 PM
#12
Thread Starter
Addicted Member
Re: Get info from a websites source
 Originally Posted by formlesstree4
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 >
-
May 23rd, 2013, 03:52 PM
#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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|