资源介绍
import requests
from bs4 import BeautifulSoup
url = 'https://www.qichemen.com/complain.html'
res = requests.get(url)
soup = BeautifulSoup(res.text,'html.parser')
trs = soup.find('tbody',class_="load-container").find_all('tr',class_="link-tr")
for tr in trs:
tds = tr.find_all('div',class_="w w1")[1:]
print(tds[0].text,tds[1].text)
- 上一篇: 一个简单的爬虫代码,可以帮助大家入门
- 下一篇: 用Python写网络爬虫(PDF版)