文章详情页
python - 用scrapy-splash爬取网站 为啥iframe下的内容没有被返回
浏览:288日期: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. mysql - 一个sql的问题2. 这是什么情况???3. mysql索引的疑问4. mysql怎么查询树形结构的数据5. web服务器 - ubuntu下布置apache加wsgi加python6. 登录界面URL在服务器上无法找到7. python - 多态调用方法时却显示bound method...8. mysql sql where id in(25,12,87) 结果集如何用按照 25 12 87排序?9. python - django 项目的 migrations 目录是否应该提交到 git10. mysql - 仅仅只是把单引号与反斜杠转义不用prepare statement能否避免sql注入?
排行榜

网公网安备