import requests
import time
import bs4
from lxml import etree
import gevent
import gevent.monkey
import threading
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
'Host': 'wz.sun0769.com',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36',
}
def get_page(url):
response = requests.get(url, headers=headers)
html = response.content
text = ''
soup = bs4.BeautifulSoup(html, 'lxml').find('div', attrs&
爬虫实战24:爬取阳光问政信息
最新推荐文章于 2021-11-14 15:48:23 发布