|
-
Nov 17th, 2011, 11:37 AM
#1
Thread Starter
New Member
Get text from webpage
Alright, im trying to get a balance from a webpage. But idk how to. I sort of figured it out. This is what im trying to get:
<div class="boxborder">
<div class="title">Balance</div>
<div class="sep"></div>
<div class="inner">
$12.85 </div>
</div>
i want to get the 12,85$ to a label.
I tried this:
Dim PageElements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("div")
For Each CurElement As HtmlElement In PageElements
If CurElement.GetAttribute("classname") = "inner" Then
Label1.Text = CurElement.InnerText
End If
Next
But there are multiple classes on the webpage which has the inner as classname, so i get lots and lots of info. But i just want to get the 12,85. How would i do that?
-
Nov 17th, 2011, 01:42 PM
#2
Addicted Member
Re: Get text from webpage
klienma has put together a project file that does many HTML DOM manipulations that you should take a look at.
The biggest question is if you're hosting, or have access to modify that page. If you do, you may want to give that div an ID tag so it is easier to get access to.
http://www.vbforums.com/showthread.php?t=416275
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
|