PDA

View Full Version : Extract href value from a website using VBA



Timescape
06-27-2015, 02:44 AM
The question seems to be quite straightforward and simple but I have no idea what was going wrong. I was trying to get the the following href value.


13797

I used the getAttribute method but had run-time error 94 saying invalid use of Null.

Set divs = Doc.getElementsByClassName("odd")
For Each div In divs
MsgBox div.getAttribute("href")
Next div