import requests
from bs4 import BeautifulSoup
num = 0
url = 'https://movie.douban.com/subject/27140017/comments?status=P'
req = requests.get(url)
soup = BeautifulSoup(req.text,'lxml')
xml = soup.find_all('p',class_='')
for i in range(len(xml)):
msg = xml[i].string
if not msg is None:
num+= 1
print('第',num,'條',msg)
D:\pythonw.exe C:/Users/DELL/u1/unnatural.py
行程已結束,退出代碼 0
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/65323.html
