爬取前的准备:
BeautifulSoup的导入:pip install BeautifulSoup4
requests的导入:pip install requests
下载jupyter notebook:pip install jupyter notebook
下载python,配置环境(可使用anocanda,里面提供了很多python模块)
完整代码:
![](https://img.haomeiwen.com/i13406307/25c87403bb9d3d74.png)
存储的excel文档如下:
![](https://img.haomeiwen.com/i13406307/fca65dce57610ad7.jpg)
爬取前的准备:
BeautifulSoup的导入:pip install BeautifulSoup4
requests的导入:pip install requests
下载jupyter notebook:pip install jupyter notebook
下载python,配置环境(可使用anocanda,里面提供了很多python模块)
完整代码:
存储的excel文档如下:
本文标题:Python抓取新浪新闻数据
本文链接:https://www.haomeiwen.com/subject/lrjulctx.html
网友评论