3
我想獲得它使用JavaScript像使用scrapyjs抓取飛濺
<span onclick="go1()">click here </span>
<script>function go1(){
window.location = "../innerpages/" + myname + ".php";
}
</script>
從網頁URL的onclick頁面,這是使用scrapyjs飛濺
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()'},
}
})
如果我寫我的代碼
'js_source': 'document.title="hello world"'
它會工作
是好像我能處理頁面中的文本,但我無法從go1()
我應該怎麼做,如果我想進去go1()
感謝網址,以獲取網址!
感謝您的回覆,我會嘗試後:-) – casker