excel - Fetch Class Name Tag From HTML Using VBA -
excel - Fetch Class Name Tag From HTML Using VBA -
i'm trying utilize vba grab inner text tag within source code in next website:
http://www.amazon.com/gp/node/index.html?ie=utf8&marketplaceid=atvpdkikx0der&me=a1a79b9ff9gb33&merchant=a1a79b9ff9gb33&redirect=true
the class or tag or whatever called span class="nav-search-label
.
i thought possible using getelementsbyclassname
. code executes, doesn't bring back. how can identify exact wording of these tags/id's/class names/ whatever may be. source code these tags have dashes , spaces it's hard exact string set quotes when asking vba elements.
sub runnewmodule() dim ie internetexplorer dim html htmldocument dim sellerid dim name dim sellername set ie = createobject("internetexplorer.application") ie.visible = false ie.navigate "http://www.amazon.com/gp/node/index.html?ie=utf8&marketplaceid=atvpdkikx0der&me=a2p5i4nw0qqax1&merchant=a2p5i4nw0qqax1&redirect=true" while ie.readystate <> readystate_complete doevents loop set html = ie.document set ie = nil cells.clear range("a3").value = "seller name" set sellername = html.getelementsbyclassname("nav-search-label") name = 4 each sellerid in sellername range("a" & name) = sellerid.innertext name = name + 1 next sellerid end sub
html excel vba excel-vba
Comments
Post a Comment