• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

href element

Vincent K

New Member
Hi There, i am trying to automate some scraping through vba. I have a number of login ids and password to which I login individually and download some data. I have managed to login to site, the next part is opening the hyperlink mentioned in the href tag (inner text). Can someone help me to set the code for the same?

Vincent
 
Without context and some html source code it's hard to give you specific help.
As well, we'll need code that you have so far (to see what variables you've assigned etc).

From there, it's simple matter of identifying which element contains info you are after.

Ex: href is usually inside <a> tag. So you'd use document.getElementsByTagName("a") to get collection, and loop through it.

If there is some ID associated with the tag. It would make it easier to scrape specific element.
 
So loop through .getElementsByTagName("a") and read it's .href property and use it to navigate to the link. Or if you are piloting IE, then simulate click on the element.

But like I said, without knowing the code you are using to scrape/navigate site currently. Can't give you exact code.

If you search within this forum you'll find plenty of sample codes.
 
Back
Top