how to click javascript-links ?
I need a solution for clicking on links with javascript-href. The code I found so far in this forum and google does not work for me.
<span title="Diese Seite schneller aktualisieren und letzte Gebote anzeigen" id="v4-13" class="vi-is1-teq vi-is1-rf" style="">
[<a href="javascript:;">Aktualisieren</a>]
</span>
This link updates few information an a website without the need of refreshing the whole document. Now I want to automatically click this link every few seconds to always get most actual information displayed.
I can find this link with
var link=document.evaluate("//a[text()='Aktualisieren']",document,null,9,null).singleNodeValue;
but I don't know how to click it automatically.try this:
window.setInterval( function() {
var link=document.evaluate("//a[text()='Aktualisieren']",document,null,9,null).singleNodeValue;
if(link) {
var evObj = document.createEvent("MouseEvents");
evObj.initEvent("click", true, false);
link.dispatchEvent(evObj);
}
}, 5000 );Try this click function:
// Click by JoeSimmons
// Syntax: click(element); // String argument will grab it by id, or you can supply an element
function click(e, type) {
if(!e && typeof e=='string') e=window.document.getElementById(e);
if(!e) {return;}
var evObj = document.createEvent('MouseEvents');
evObj.initMouseEvent((type||'click'),true,true,window,0,0,0,0,0,false,false,false,false,0,null);
e.dispatchEvent(evObj);
}
I need to strip out items from eBay search results that have ZERO BIDS.
- I need to strip out items from eBay search results that have ZERO BIDS.
Try this out:
var bids=document.evaluate("//td[@class='bids' and contains(text(),'0 Bids')]",document,null,6,null), bid, i=0;
while(bid=bids.snapshotItem(i++).offsetParent)
bid.parentNode.removeChild(bid);
Posted from Diigo. The rest of my favorite links are here.