excel - How to click on a link that keeps on changing depending upon whats entered in searchbox -
i'm unable click on link in page since link keeps on changing after entering number in each search box. tried few vba codes not able achieve it.
<a href="../finding/data?data=all&version=0&edocid=0&ssid=05bdpusphl&refnum=15q100595&defaultemail=abc@abc.com&snpid=15834667918&servicecd=e" target=_blank>data</a>
sub try() dim ie object dim myhtml_element ihtmlelement dim myurl string dim myurlser string set ie = createobject("internetexplorer.application") on error goto err_clear myurl = "[http://test.com/login][1]" set mybrowser = new internetexplorer mybrowser.silent = true mybrowser.navigate myurl mybrowser.visible = true loop until mybrowser.readystate = readystate_complete set htmldoc = mybrowser.document htmldoc.all.j_username.value = "user" 'enter email id here htmldoc.all.j_password.value = password'enter password here each myhtml_element in htmldoc.getelementsbytagname("input") if myhtml_element.type = "button" myhtml_element.click: exit next on error goto err_clear myurl = "http://test.com/home" set mybrowser = new internetexplorer mybrowser.silent = true mybrowser.navigate myurl mybrowser.visible = true loop until mybrowser.readystate = readystate_complete set htmldoc = mybrowser.document htmldoc.all.searchkeyword.value = "223645" 'enter email id here call htmldoc.parentwindow.execscript("submitsearch();", "javascript") each l in ie.document.getelementsbytagname("a") if l.classname = "doccheckbox" l.click: exit next err_clear: if err <> 0 err.clear resume next end if end sub
Comments
Post a Comment