Space in website structure issue
Hey guys,
I'm new here... novice programmer but old-fart engineer.
Here's my problem, I'm trying to pull data from a website but hit a snag.
The website has a structure: Doc.links.Item X.innerText
X is a number, 1-150. Two questions:
1) There is a space between "Item" and the number... how do I get VBA to recognize that?
2) I'm searching through the 150 entries to find the ones with useful data... how do I use a FOR loop to put that # in there. In another way, it would usually be a Item(X) index, but if the # is in the actual name. As I said, I'm novice at programming, how do I make this work?
Thanks
Tony
Re: Space in website structure issue
Quote:
The website has a structure: Doc.links.Item X.innerText
Could you explain what that means ?
Re: Space in website structure issue
Niya,
Sure, let me elaborate. Note that I'm pulling the data from my Paypal site.
OK, here is some of my code:
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "http://www.paypal.com?login_email=LOGINemail.com"
Dim ieDoc As HTMLDocument
Set ieDoc = ie.Document
I stop the code & look at the ieDoc structure. I stopped the program after the Set ieDoc instruction and go to the watch window. Within that structure, some of the data I want was here:
ieDoc.links.Item 1.InnerHTML
The items I want to search are "Item 1", "Item 2", "Item 3"... there is definitely a space between the 'm' and the digit.
Does that help?
Thanks
Tony
Re: Space in website structure issue
Wait a second...is this a VB6 app ? We don't use Set in VB.Net. If this is a VB6 app then this is the wrong section of these forums.
Re: Space in website structure issue
I believe it's VB7 for applications, that's what it tells me. I'm running Office 2010, Excel.
Tony
Re: Space in website structure issue
Quote:
Originally Posted by
TexasTony
Niya,
Sure, let me elaborate. Note that I'm pulling the data from my Paypal site.
OK, here is some of my code:
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "http://www.paypal.com?login_email=LOGINemail.com"
Dim ieDoc As HTMLDocument
Set ieDoc = ie.Document
I stop the code & look at the ieDoc structure. I stopped the program after the Set ieDoc instruction and go to the watch window. Within that structure, some of the data I want was here:
ieDoc.links.Item 1.InnerHTML
The items I want to search are "Item 1", "Item 2", "Item 3"... there is definitely a space between the 'm' and the digit.
Does that help?
Thanks
Tony
Welcome to the forums Tony
I'm not familiar with working on html through code as of yet but I think there may be an Links collection?
That would basically be saying same as Links(0), do you see what I am saying? Get the Links collection and iterate through it
Re: Space in website structure issue
Proneal...
Ba-da-bing!
That was it... now to my next step....
Thanks
Tony