python抓取网页内容
2012-09-10 20:45
204 查看
#-------PYTHON获取网页内容-------------# import sys, urllib url = "http://www.163.com" #网页地址 wp = urllib.urlopen(url) #打开连接 content = wp.read() #获取页面内容 fp = open("/home/cx/content.txt","w") #打开一个文本文件 fp.write(content) #写入数据 fp.close() #关闭文件
相关文章推荐
- 萌新的Python学习日记 - 爬虫无影 - 添加headers抓取动态网页内容:TripAdvisor(上)
- Python使用代理抓取网页内容
- paip.抓取网页内容--java php python
- python爬虫之使用urllib2组件抓取网页内容
- [Python]网络爬虫(二):利用urllib2通过指定的URL抓取网页内容
- 萌新的Python学习日记 - 爬虫无影 - 使用BeautifulSoup + css selector 抓取动态网页内容:Knewone
- Python实现周期性抓取网页内容的方法
- Chrome + Python 抓取动态网页内容
- Python抓取网页中内容,正则分析后…
- python抓取网页内容
- python抓取网页内容并进行语音播报
- python beautifulsoup 抓取网页正文内容
- python抓取网页内容示例分享
- python-爬虫-自带库抓取网页内容
- Python实现周期性抓取网页内容的方法
- Python网页抓取:获取页面中某段内容的xpath
- [Python]网络爬虫(二):利用urllib2通过指定的URL抓取网页内容
- [Python]网络爬虫(二):利用urllib2通过指定的URL抓取网页内容
- [Python]网络爬虫(二):利用urllib2通过指定的URL抓取网页内容
- Python使用HTMLParser抓取网页内容