I am trying to get url from pages which using javascript like
<span onclick="go1()">click here </span>
<script>function go1(){
window.location = "../innerpages/" + myname + ".php";
}
</script>
this is my code using scrapyjs with splash
def start_requests(self):
for url in self.start_urls:
yield Request(url, self.parse, meta={
'splash': {
'endpoint': 'render.html',
'args': {'wait': 4, 'html': 1, 'png': 1, 'render_all': 1, 'js_source': 'document.getElementsByTagName("span")[0].click()'},
}
})
if i write
'js_source': 'document.title="hello world"'
it will work
is seems like i can handle text inside page but i can not get the url from go1()
what should i do if i want get the url inside go1()
Thanks!