Results 1 to 2 of 2

Thread: Get text from webpage

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2011
    Posts
    8

    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?

  2. #2
    Addicted Member
    Join Date
    Apr 2011
    Posts
    223

    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
  •  



Click Here to Expand Forum to Full Width