import requests
from bs4 import BeautifulSoup
url = "http://www.chinaz.com/news/2018/0122/850246.shtml"
req = requests.get(url)
html = req.text.encode(req.encoding).decode()
#print(html)
soup = BeautifulSoup(html,'lxml')
#print(soup.div.div.div.div.div.div.findAll('div'))
print(soup.div.div.div.div.div.div.findAll('div'))
转载于:https://www.cnblogs.com/lxh823/p/8331371.html