爬虫04 爬取糗事百科中文段子
来源:互联网 发布:风油精不可描述知乎 编辑:程序博客网 时间:2024/06/05 11:01
# -*- coding: utf-8 -*-import urllibimport urllib2import repage = 1url = 'http://www.qiushibaike.com/8hr/page/%d/?s=4908781' %pageuser_agent="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0"headers = { 'User-Agent' : user_agent }request = urllib2.Request(url,headers=headers)response = urllib2.urlopen(request)back=response.read()#print backimglist=re.findall(r'<div[^>]class="content">\n\n([^<]+)<[^>]+.+\n\n[^<]',back)print imglistf = open('糗事百科'+str(page)+'.txt', 'w')for joke in imglist: f.write(joke)
0 0
- 爬虫04 爬取糗事百科中文段子
- 【网络爬虫】爬取糗事百科段子
- python 爬虫 爬取糗事百科段子
- Python爬虫 爬取糗事百科段子
- Python爬虫爬取糗事百科段子
- Python爬虫 爬取糗事百科段子
- 爬取糗事百科段子
- 糗事百科段子爬取
- Python爬虫实战一之爬取糗事百科段子
- pythpn学习の爬虫爬取糗事百科热门段子
- Python爬虫实战一之爬取糗事百科段子
- 网络爬虫——爬取糗事百科笑料段子
- Python爬虫实战(1):爬取糗事百科段子
- Python爬虫实战(1):爬取糗事百科段子
- Python爬虫实战一之爬取糗事百科段子
- Python爬虫实战一之爬取糗事百科段子
- Python爬虫实战之爬取糗事百科段子
- Python 爬虫 简单实例 爬取糗事百科段子
- Linux安装
- 带进度条的WebView
- mysql关于唯一性约束的操作
- 在Linux系统Jetty服务器发布项目
- python urllib2实现刷博客
- 爬虫04 爬取糗事百科中文段子
- poj1251——Jungle Roads(prim)
- org.springframework.dao.InvalidDataAccessApiUsageException: ERR value is not an integer or out of ra
- asci码练习
- emacs不自动换行 --once and for all
- Material适配2 - 高级篇
- 关于MPU6050陀螺仪模块的测量误差分析
- linux java_home 配置
- JAVA学习笔记之(字符串)