请用python语言写一个简单的爬虫程序
时间: 2023-03-12 16:05:52 浏览: 91
我可以给你一个简单的Python爬虫程序的例子:import requests
from bs4 import BeautifulSoupurl = 'https://www.example.com/'# 获取页面
page = requests.get(url)# 利用BeautifulSoup解析页面
soup = BeautifulSoup(page.content, 'html.parser')# 找到所有链接
links = soup.find_all('a')# 遍历链接
for link in links:
# 显示链接
print(link.get('href'))
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![.zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)