目标网站:
利用AI软件编写简单的爬虫,拿到目标网站的源代码
import requests
headers = {
'Accept': 'application/json, text/plain, /',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Connection': 'keep-alive',
'Content-Type': 'application/x-www-form-urlencoded',
'DNT': '1',
'Origin': 'https://wx.qmpsee.com',
'Platform': 'web',
'Sec-Fetch-Dest': 'empty',
'Sec-Fetch-Mode': 'cors',
'Sec-Fetch-Site': 'same-site',
'Source': 'see',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36',
'sec-ch-ua': '"Google Chrome";v="131", "Chromium";v="131", "Not_A Brand";v="24"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
}
data = {
'page': '1',
'num': '20',
'ca_uuid': 'feef62bfdac45a94b9cd89aed5c235be',
}
response = requests.post('https://wyiosapi.qmpsee.com/Web/getCaDetail', headers=headers, data=data).json()
print(response)
运行后,看不到网页的文字,通过一步步逆向,成功拿到网页的文字
|