2条回答 默认 最新
- honestman_ 2022-10-12 11:21关注
爬取代码如下,如有帮助 请点击一下采纳谢谢:
import requests headers = { "authority": "pythonscraping.com", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "accept-language": "zh-CN,zh;q=0.9", "cache-control": "no-cache", "pragma": "no-cache", "sec-ch-ua": "\"Google Chrome\";v=\"105\", \"Not)A;Brand\";v=\"8\", \"Chromium\";v=\"105\"", "sec-ch-ua-mobile": "?1", "sec-ch-ua-platform": "\"Android\"", "sec-fetch-dest": "document", "sec-fetch-mode": "navigate", "sec-fetch-site": "none", "sec-fetch-user": "?1", "upgrade-insecure-requests": "1", "user-agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Mobile Safari/537.36" } url = "https://pythonscraping.com/pages/page3.html" response = requests.get(url, headers=headers) print(response.text) print(response)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 FileNotFoundError 解决方案
- ¥15 uniapp实现如下图的图表功能
- ¥15 u-subsection如何修改相邻两个节点样式
- ¥30 vs2010开发 WFP(windows filtering platform)
- ¥15 服务端控制goose报文控制块的发布问题
- ¥15 学习指导与未来导向啊
- ¥15 求多普勒频移瞬时表达式
- ¥15 如果要做一个老年人平板有哪些需求
- ¥15 k8s生产配置推荐配置及部署方案
- ¥15 matlab提取运动物体的坐标