文章詳情頁
python - 用scrapy-splash爬取網站 為啥iframe下的內容沒有被返回
瀏覽:234日期:2022-08-10 09:23:22
問題描述
用scrapy-splash爬取網站 為啥iframe下的內容沒有被返回?
import scrapyfrom scrapy import Selectorclass Music163Spider(scrapy.Spider): name = 'music163' allowed_domains = ['music.163.com/#/discover/toplist'] start_urls = [’http://music.163.com/#/discover/toplist/’] def parse(self, response):print('parse:',response.text) def start_requests(self):for url in self.start_urls: yield scrapy.Request(url, self.parse, meta={’splash’: { ’endpoint’: ’render.html’, ’args’: {’wait’: 0.5, }} })
問題解答
回答1:你需要在parse中獲取iframe的url再次請求內容。
相關文章:
1. javascript - sublime快鍵鍵問題2. javascript - immutable配合react提升性能?3. Apache 已經把網站根目錄的改為allow from all了,但是服務器還是不能訪問?4. 配置Apache時,添加對PHP的支持時語法錯誤5. phpstudy8.1支持win11系統嗎?6. css - 寫頁面遇到個布局問題,求大佬們幫解答,在線等,急!~7. vue.js - Vue 如何像Angular.js watch 一樣監聽數據變化8. javascript - nodejs關于進程間發送句柄的一點疑問9. 實現bing搜索工具urlAPI提交10. javascript - 移動端上不能實現拖拽布局嗎?
排行榜

網公網安備