Use bs4 to write a python crawler for Douban

I can write a Python crawler that uses the BeautifulSoup4 library to grab Douban information, the code is as follows: import requests from bs4 import BeautifulSoup# Get the source code of the web page url = ' https://www.douban.com/' response = requests.get( url) html_doc = response.text# Initialize the BeautifulSoup object soup = BeautifulSoup(html_doc, 'html.parser')# Get all the links links = soup.find_all('a') for link in

Guess you like

Origin blog.csdn.net/weixin_42588555/article/details/129607951
Recommended