2019-03-03尝试用爬虫获取数据
2019-03-03 本文已影响3人
亲亲百合
在电脑上安装 requests,beautifulsoup:
pip install requests;
pip install beautifusoup4.
尝试用requests请求网页数据:

用标签查看内容:

查找父子节点:

尝试用select方法获取:

最后一行好像不能同时获取两个class下的数据,不知道beautifulsoup怎么把整个数据导出来。。还没有完整的把整个过程走一遍。

尝试导出数据,但是出来的文档是空的,待解决。
用re模块的时候,电脑就转不动了,结果一直运行不出来。。。看我的电脑的cpu使用占比已经100%了。。。超级无语,电脑配置太低了吗!
用beautifulsoup也没有能把数据导出来用,下次完善。。