requests爬虫get请求
爬虫 请求 get requests
2023-09-14 09:00:34 时间
1、简单get请求
url = 'https://www.baidu.com' headers = { 'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8', 'accept-encoding': 'gzip, deflate, br', 'accept-language': 'zh-CN,zh;q=0.9', 'upgrade-insecure-requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36', # 'cookie': 'xxx;yyy;zzz', # 'referer': 'https://xxx.yyy.zzz' } # 发起get请求 response = requests.get(url, headers=headers, verify=True) # 获取html文本 html_data = response.content.decode() print(html_data) print(len(html_data))
相关文章
- python爬虫之分析Ajax请求抓取抓取今日头条街拍美图(七)
- 【Python3网络爬虫开发实战】3.1.1-发送请求
- 小白学 Python 爬虫(27):自动化测试框架 Selenium 从入门到放弃(上)
- Python爬虫开发:requests库的使用--发送带参数post请求
- Python 爬虫开发:Ajax请求响应json案例
- 零基础学Python-爬虫-1、网络请求Requests【网络操作理论基础与实践·请认真看看理论,理论基础决定后期高度】
- “百度”、“google”的爬虫请求头信息 user-agent
- 新数据革命: 开源C#图形化爬虫引擎Hawk5发布
- python3爬虫中文乱码之请求头‘Accept-Encoding’:br 的问题
- Python爬虫:fake_useragent库模拟浏览器请求头
- Python爬虫:关于scrapy模块的请求头
- Python爬虫:浏览器请求头参数RequestHeaders
- Python 异步网络爬虫教程大全
- 学习笔记(05):Python爬虫开发-数据解析