I'm using casperjs. and doesn't work for me.
Code:
function getLinks() {
var links = document.querySelectorAll('a[href^="inquiryDetail.jis?caseId="]');
return Array.prototype.map.call(links, function(e) {
return e.getAttribute('href')
});
}
document.querySelector('a[href="' + links[1] + '"]').click();
can someone provide me a link about what the mysterious function getLinks() does?
I know it stores links starts with 'a[href^="inquiryDetail.jis?caseId="]' to links
but the rest of the function is still mysterious to me.
this part is
Code:
return Array.prototype.map.call(links, function(e) {
return e.getAttribute('href')
but this code works
Code:
this.echo(links[1]);
and this is error msg
Code:
TypeError: 'null' is not an object (evaluating 'document.querySelector('a[href="
' + links[1] + '"]').click')