from bs4 import BeautifulSoup
from lxml import html
import xml
import requests
url ="https://movie.douban.com/chart"
f=requests.get(url)
soup=BeautifulSoup(f.content,"lxml")
for k in soup.find_all('div',class_='pl2'):
a=k.find_all('span')
b=k.find_all('p')
print(a[0].string+' '+b[0].string)
Python 爬虫基础示例——抓取豆瓣电影首页信息
最新推荐文章于 2024-08-04 17:55:11 发布