文章分类 -  爬虫 / request案例

摘要:完整代码展示 import requests # 1.指定url main_url = 'https://www.eastmoney.com/' # 2.发起请求: response = requests.get(url=main_url) print(response.content) # 设置响 阅读全文
posted @ 2025-03-23 22:14 千陌666 阅读(20) 评论(0) 推荐(0)
摘要:一、HTTP请求处理 1. requests库基础 import requests response = requests.post(url, data=payload) 网络请求库:第三方库requests简化HTTP请求操作 POST方法:向指定URL发送表单数据(form-data) 返回值处 阅读全文
posted @ 2025-03-23 21:43 千陌666 阅读(13) 评论(0) 推荐(0)
摘要:一、数据解析核心技术 1.1 BS4解析详解 from bs4 import BeautifulSoup import requests # 创建解析对象 response = requests.get('https://example.com') soup = BeautifulSoup(resp 阅读全文
posted @ 2025-03-23 15:39 千陌666 阅读(10) 评论(0) 推荐(0)
摘要:一、爬虫相关介绍 1.1 什么是爬虫? 爬虫(Web Crawler)是通过编写程序模拟浏览器行为,自动抓取互联网数据的核心技术。其核心原理分为两个关键点: 模拟浏览器行为:现代浏览器本质是天然爬虫工具,爬虫程序通过HTTP协议模拟浏览器请求 数据抓取策略: • 全量抓取:获取页面全部内容 • 精准 阅读全文
posted @ 2025-03-23 15:36 千陌666 阅读(346) 评论(0) 推荐(0)