#pip install requests 安装第三方库 import requests url='http://www.luofenming.com' #伪装浏览器 headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36 Edg/114.0.1823.43'} #发送请求 resp=requests.get(url,headers=headers) print(resp.text)