python如何实现简单爬虫

2024-10-13 07:00:56

1、首先下载anaconda,运行其中的python.exe。

python如何实现简单爬虫

2、导入requests包。

python如何实现简单爬虫

3、用requests去连接网站。

python如何实现简单爬虫

4、调用状态码,看是否成功,200为成功。

python如何实现简单爬虫

5、查看字符码

python如何实现简单爬虫

6、将前3000个字符打出。

python如何实现简单爬虫
猜你喜欢