簡體   English   中英

scrapy無法抓取頁面中的所有鏈接

[英]scrapy can't crawl all links in a page

我想scrapy抓取AJAX網站http://play.google.com/store/apps/category/GAME/collection/topselling_new_free

我想獲得所有指向每個游戲的鏈接。

我檢查頁面的元素。 它看起來像這樣: 頁面的外觀如何,所以我想提取所有模式為/ store / apps / details的鏈接?id =

但是當我在shell中運行命令時,它什么也沒有返回: shell命令

我也嘗試過// a / @ href。 也沒有解決,但不知道怎么回事。

  • 現在,我可以抓取到修改后的starturl並添加“ formdata”的前120個鏈接,就像有人告訴我的那樣,但此后沒有更多鏈接。

有人可以幫我弄這個嗎?

實際上,這是一個ajax-post-request ,用於填充該頁面上的數據。 在scrapy shell中,您將無法獲得此請求,而不是檢查元素,請檢查network選項卡,您將在其中找到請求。

使用formdata={'start':'0','num':'60','numChildren':'0','ipf':'1','xhr':'1'}https://play.google.com/store/apps/category/GAME/collection/topselling_new_free?authuser=0 url發出發布請求formdata={'start':'0','num':'60','numChildren':'0','ipf':'1','xhr':'1'}

每個請求以60為增量遞增以獲取分頁結果。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM