import json
import requests
from requests.exceptions import RequestException
from multiprocessing import Pool
from lxml import etree
# 获取页面
def get_one_page(url):
# 加入请求头
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36',
'Referer': 'https://www.baidu.com'
}
try:
response = requests.get(url,headers=headers)
if response
requests + xpath 爬取猫眼电影top100
最新推荐文章于 2024-04-08 10:44:28 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)