文章详情页
python - 用scrapy-splash爬取网站 为啥iframe下的内容没有被返回
浏览:130日期: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. windows误人子弟啊2. 冒昧问一下,我这php代码哪里出错了???3. 关于mysql联合查询一对多的显示结果问题4. python - linux怎么在每天的凌晨2点执行一次这个log.py文件5. 如何用笔记本上的apache做微信开发的服务器6. 实现bing搜索工具urlAPI提交7. 数据库 - Mysql的存储过程真的是个坑!求助下面的存储过程哪里错啦,实在是找不到哪里的问题了。8. 我在网址中输入localhost/abc.php显示的是not found是为什么呢?9. MySQL主键冲突时的更新操作和替换操作在功能上有什么差别(如图)10. mysql优化 - MySQL如何为配置表建立索引?
排行榜
