https://zhuanlan.zhihu.com/p/31891195 大佬写的文章,详细介绍requests
1、使用selenium获取网页源代码,然后进行解析路径 用xpath。
2、用selenium获取网页源代码,然后用beautifulsoup进行解析: 这个需要先对其进行HTML解析转化
3、使用requests包进行获取网页的文本,要对其进行HTML解析。。
如果你要是用scrapy中的xpath,你就直接将response传进去即可
requests和beautifulsoup4结合,
https://zhuanlan.zhihu.com/p/23065345 大佬的链接
我比较习惯
html= reponse.text
soup = BeautifulSoup(html, ‘html.parser’)
#用soup,一定要从大范围,找到唯一的东西,在从里面找,从父找子
parent=soup.find(id = “resultList”)