-
Feb 7th, 2011, 05:13 AM
#1
Thread Starter
Hyperactive Member
-
Feb 7th, 2011, 05:44 AM
#2
Fanatic Member
Re: Web Scrapping (getting output from the web)
You can try:
vb Code:
Dim elem As HtmlElement = WebBrowser1.Document.GetElementByID("result") Dim innerString As String = elem.InnerText MsgBox(innerString)
If I helped you out, please take the time to rate me
-
Feb 7th, 2011, 05:53 AM
#3
Thread Starter
Hyperactive Member
Re: Web Scrapping (getting output from the web)
Actually, thanks so much. I just realised it was because the webpage didn't finish loading.
Last edited by JXDOS; Feb 7th, 2011 at 05:59 AM.
If my post has been helpful, please rate it!
-
Feb 7th, 2011, 07:30 AM
#4
Thread Starter
Hyperactive Member
Re: Web Scrapping (getting output from the web)
What if there isn't an Id? Like in the example below:
Code:
<div class="dct-em">
<span class="dct-tt">A rope with its ends fastened at different points to a spar or other object in order to provide a purchase</span>
</div>
</li>
<li class="dct-em"
>
<div class="dct-em">
<span class="dct-tt">A team of people or animals, in particular</span>
</div>
</li>
<li class="dct-em"
>
<div class="dct-em">
<span class="dct-tt">A matched pair of horses, mules, or oxen</span>
</div>
I just want to extract the 3 chunks of text.
If my post has been helpful, please rate it!
-
Feb 7th, 2011, 07:57 AM
#5
Fanatic Member
Re: Web Scrapping (getting output from the web)
Try something like this:
vb.net Code:
Dim InnerStringEnum As IEnumerable(Of String) = From h As HtmlElement In WebBrowser1.Document.GetElements.GetElementsByTagName("span") _ Where h.GetAttribute("className").Equals("dct-tt") _ Select h.InnerText For each s As String in InnerStringEnum MsgBox(s) Next
If I helped you out, please take the time to rate me
-
Feb 7th, 2011, 08:33 AM
#6
Thread Starter
Hyperactive Member
Re: Web Scrapping (getting output from the web)
Thanks again, your solutions work great!
If my post has been helpful, please rate it!
Tags for this Thread
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
|