Python解析网页源代码中的115网盘链接实例
2014-09-30 00:00
726 查看
本文实例讲述了python解析网页源代码中的115网盘链接的方法。分享给大家供大家参考。具体方法分析如下:
其中的1.txt,是网页http://bbs.pediy.com/showthread.php?t=144788另存为1.txt
具体代码如下:
输出结果:
希望本文所述对大家的Python程序设计有所帮助
其中的1.txt,是网页http://bbs.pediy.com/showthread.php?t=144788另存为1.txt
具体代码如下:
import re if __name__ == "__main__": fp = open("c:\\1.txt") https = re.compile(r"(http://u.*)") for url in https.findall(fp.read()): print url
输出结果:
http://u.115.com/file/f61cb107c8 http://u.115.com/file/f6806f45b8 http://u.115.com/file/f6ec42d4d3 http://u.115.com/file/f6deb05ec4 http://u.115.com/file/f6e51f6838 http://u.115.com/file/f66edaf8d3 http://u.115.com/file/f6d07e07b9 http://u.115.com/file/f6d7f585a8 http://u.115.com/file/f639d8b3cf http://u.115.com/file/f6dcadbde6 http://u.115.com/file/f6ea3f01c1 http://u.115.com/file/f65b96a06f http://u.115.com/file/f682da085a http://u.115.com/file/f6486e698 http://u.115.com/file/f6b7491d9f http://u.115.com/file/f622b7f9a7 http://u.115.com/file/f64e2424b9 http://u.115.com/file/f6e5132d4d http://u.115.com/file/f655c10e86 http://u.115.com/file/f6b22e64e6 http://u.115.com/file/f6812126a4 http://u.115.com/file/f6523e625c http://u.115.com/file/f63e0ccb28 http://u.115.com/file/f611e07b8a# http://u.115.com/file/f6e047bccc# http://u.115.com/file/f6d348d781# http://u.115.com/file/f6ada24153# http://u.115.com/file/f64f97518b# http://u.115.com/file/f6f9ba96f8# http://u.115.com/file/f650e06f38# http://u.115.com/file/f683ee5b2a# http://u.115.com/file/f69009bfc2# http://u.115.com/file/f6ea427646# http://u.115.com/file/f6acdc6b7f# http://u.115.com/file/f6c85745d0# http://u.115.com/file/f61a26cf12# http://u.115.com/file/f631edf5c6# http://u.115.com/file/f6b0fa6fb8# http://u.115.com/file/f6f5fe8962# http://u.115.com/file/f6bf975e0# http://u.115.com/file/f6d522784c# http://u.115.com/file/f6b5ac9991# http://u.115.com/file/f62e80ced5# http://u.115.com/file/f6bff09c0c# http://u.115.com/file/f663fc4a54# http://u.115.com/file/blpk4pv1 http://u.115.com/file/c4rjotdz http://u.115.com/file/f6a960aca8# http://u.115.com/file/efnn38jr http://u.115.com/file/c4leomjd http://u.115.com/file/dlpw9s6i http://u.115.com/file/f6d3cbebe0# http://u.115.com/file/f6de8062b2# http://u.115.com/file/ef8og8la http://u.115.com/file/f6f6391ac6# http://u.115.com/file/f628d256ae# http://u.115.com/file/f66a049dc9# http://u.115.com/file/f62bf1750a# http://u.115.com/file/f642e47260# http://u.115.com/file/f693eb7c89# http://u.115.com/file/f6ed68ba9b# http://u.115.com/file/f6f099c3f9# http://u.115.com/file/f61ac19339# http://u.115.com/file/f6f3c78d2c# http://u.115.com/file/f6696f6348# http://u.115.com/file/f6e88eeefb# http://u.115.com/file/f66471e4eb# http://u.115.com/file/f672da54ae# http://u.115.com/file/dnasw0kp# http://u.115.com/file/dnagnndx# http://u.115.com/file/clwr2xxg# http://u.115.com/file/bhbcnnwe# http://u.115.com/file/aq2rp9ga# http://u.115.com/file/e601turs# http://u.115.com/file/dn46qs7x# http://u.115.com/file/clwonrwg# http://u.115.com/file/dn43i7jf# http://u.115.com/file/bhbgrnfz# http://u.115.com/file/dnsl0kxp#
希望本文所述对大家的Python程序设计有所帮助
相关文章推荐
- Python解析网页源代码中的115网盘链接实例
- 解析网页源代码中的115网盘链接
- python解析搜狗网页源代码:取搜索引擎返回的前page_num*10个链接的url(待续)
- python解析百度网页源代码:取搜索引擎返回的前page_num*10个链接的url
- 使用Python中的HTMLParser、cookielib抓取和解析网页、从HTML文档中提取链接、图像、文本、Cookies(二)
- 使用Python中的HTMLParser、cookielib抓取和解析网页、从HTML文档中提取链接、图像、文本、Cookies .
- Python 网页解析HTMLParse的实例详解
- Python实现抓取网页并且解析的实例
- Python 网络爬虫 009 (编程) 通过正则表达式来获取一个网页中的所有的URL链接,并下载这些URL链接的源代码
- 使用Python中的HTMLParser、cookielib抓取和解析网页、从HTML文档中提取链接、图像、文本、Cookies
- Python实现抓取网页并且解析的实例
- 黄聪:使用Python中的HTMLParser、cookielib抓取和解析网页、从HTML文档中提取链接、图像、文本、Cookies(二)
- 【python】使用HTMLParser、cookielib抓取和解析网页、从HTML文档中提取链接、图像、文本、Cookies
- Python中的HTMLParser、cookielib抓取和解析网页、从HTML文档中提取链接、图像、文本、Cookies(二)
- python网络爬虫与信息采取之解析网页实例---oJ期末成绩排名
- python爬虫一:必应图片(从网页源代码中找出图片链接然后下载)
- 使用Python中的HTMLParser、cookielib抓取和解析网页、从HTML文档中提取链接、图像、文本、Cookies(二)(转)
- HTMLParser解析网页,提取链接地址、标题名称,并插入数据库 分类: python 小练习 HTMLParser 2014-02-19 09:57 519人阅读 评论(0) 收藏
- 黄聪:使用Python中的HTMLParser、cookielib抓取和解析网页、从HTML文档中提取链接、图像、文本、Cookies(二)
- Python 网络爬虫 009 (编程) 通过正则表达式来获取一个网页中的所有的URL链接,并下载这些URL链接的源代码