利用python网络爬虫爬取赶集网数据
来源:互联网 发布:淘宝手机模板免费下载 编辑:程序博客网 时间:2024/05/21 18:08
import csvimport requestsimport reheaders = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'}url = 'http://sh.ganji.com/zpbanyungong/o1/'with open('E:/infomation.csv', 'wt', encoding='utf8',newline='') as f: csv_writer = csv.writer(f, dialect='excel')#这里打开csv文件开始写入 for i in range(1,2): new_url = 'http://sh.ganji.com/zpbanyungong/o' + str(i) +'/' content = requests.get(new_url,headers=headers).text pattern = re.compile('gjalog="100000002704000200000010@atype=click">(.*?).*?(.*?).*?
以上就是本文的代码啦
阅读全文
0 0
- 利用python网络爬虫爬取赶集网数据
- Python爬虫--爬取赶集网的租房信息
- 创建爬虫----遍历单个域名爬取赶集网
- scrapy爬虫案例爬取赶集网租房信息并入库
- Python网络爬虫requests、bs4爬取空姐网图片
- python网络爬虫爬取图片代码
- python3网络爬虫爬取天气网空气质量数据
- python网络爬虫学习(六)利用Pyspider+Phantomjs爬取淘宝模特图片
- 【python网络爬虫三】爬取动态数据及数据入库
- 【爬虫】python selenium 爬取数据
- Python爬虫爬取NBA数据
- Python requests爬虫爬取小说数据
- Python爬虫:如何爬取分页数据?
- python爬虫爬取网页表格数据
- python爬虫 爬取淘宝网页数据
- 【Python爬虫】东方财富数据爬取
- Python爬虫-利用百度地图API接口爬取数据并保存至MySQL数据库
- Python爬虫初体验之赶集网租房信息获取
- 负载均衡
- 嵌入式python2.7.13移植
- 测试用客户程序
- Hadoop学习日志之HDFS的主从结构
- fiddler dns lookup for failed System.Net.Sockets.SocketException 请求的名称
- 利用python网络爬虫爬取赶集网数据
- 汉诺塔的移动函数
- 输入十个数 求出最大值
- 第一范式、第二范式、第三范式
- --Satoshi--大数据学习日志(2017.07.19)
- Java NIO系列教程(四) Scatter/Gather
- HAWQ + MADlib 玩转数据挖掘之(四)——低秩矩阵分解实现推荐算法
- 2017.7.19-学习日志-大数据
- overridePendingTransition的简介