javascript - How to write a script to click certain image links? -


i'm trying open links on webpage, code each link approximately following:

<a href="/tor/download.php/*jibberish_letters*" id="dllink137836"><img border="0" src="/pic/down.png" alt="download" title="download"></a> 

the script i'm attempting use following, 'undefined' error when try run it.

var links = document.queryselectorall('a[title="download"]'); (var = 0; < links.length; i++) {  window.open(links[i].href,"_blank"); } 

any appreciated. thanks!

this worked me:

var links = document.queryselectorall('img[title="download"]'); (var = 0; < links.length; i++) {     window.open(links[i].parentnode.href,"_blank"); } 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -