VB.NET Help Scrapping Text

Status
Not open for further replies.

joomador

Registered
Original poster
Joined
Aug 30, 2010
Posts
7
Reaction score
0
Points
0
Hey guys great forum.
I just started learning Visual Basic so I am back to this place to see if I can get help from your amazing brains and maybe one day I'll be able to help others here.
My questions is this one:
I created a program in VB where I enter the information of a business and it stores all that in a database (Address, Telephone, ZIP, etc...). I use textBoxes to enter the Info and I copy & paste from a website where they have all that info. I find it really complicated to copy and paste and I would like to automatically grab the text from that website and put it into my textBoxes (Address, Telephone, ZIP, etc..)

I know it can be accomplished using the GetElementById but that website doesn't have any "Ids" so how can I grab the text I need and put it into my textboxes automatically?

Thank for your help.
 
K

KamaluNg

Guest
Depends on what the page has. You can get text by Name, Class, Value, ID, etc.

Heres an example of one:

Code:
        Dim elements As HtmlElementCollection = WebBrowser1.Document.All
        For Each webpageelement As HtmlElement In elements
            If webpageelement.GetAttribute("value") = "Log In" Then
              textbox1.text =  webpageelement.Innertext
            End If
        Next
 

joomador

Registered
Original poster
Joined
Aug 30, 2010
Posts
7
Reaction score
0
Points
0
Thanks for the Answer KamaluNg
Basically this is how the HTML code looks like:
<span class="fn org"><span class="value-title" title="Tom's Auto Parts">
</span></span>

I want to be able to grab only the title "Tom's Auto Parts"
:)
 

Darkness

Veteran
veteran
old school
senior
Life Saver
coldschool
member
Joined
Jul 17, 2009
Posts
3,361
Reaction score
2,442
Points
180
Location
Toronto, Canada
Joomadoor, Reg Ex would be the preferred method for what your looking for.
 

joomador

Registered
Original poster
Joined
Aug 30, 2010
Posts
7
Reaction score
0
Points
0
nope, still not getting it
 
Status
Not open for further replies.