python 批量保存网页中的超链接网址源代码
来源:互联网 发布:安信网络身份认证 编辑:程序博客网 时间:2024/04/29 09:51
import urllib2import timeimport re#connect to a URLf1=open('all2.txt','a')for page in range(5,194): #url= "https://www.hac-ker.net/search.php?var=That%20is%20me&page="+str(page) url= "http://www.example.com/archive?page="+str(page) website = urllib2.urlopen(url,timeout = 10) #read html code html = website.read() #use re.findall to get all the links #links = re.findall('"((http)s?://.*?)"', html) links = re.findall('>((http)s?://.*?)<', html) #ti=time.strftime('%y-%m-%d %H:%M:%S',time.localtime(time.time())) #f1.write(ti) #f1.write("\n\n") for i,b in links: f1.write(i) f1.write("\n") page+=1 print page print "\n"f1.close()
0 0
- python 批量保存网页中的超链接网址源代码
- Python提取网页中的超链接地址
- Python筛选网页中的网址,下载图片
- 提取网页中的超链接
- 提取网页中的超链接
- 提取网页中的超链接
- 提取网页中的超链接
- 网页中的超链接
- 【Python正则表达式】 批量去除视频名称中的网址
- 批量提取超链接中的地址
- .NET 提取网页中的超链接
- 提取网页中的超链接(C#)
- C#提取网页中的超链接
- 获取网页中的所有超链接
- webview中的网页,超链接打电话,找不到网页
- Python小脚本 002 批量下载网页链接中的图片
- python 保存网页HTML
- python 抓取网页网址信息
- Spring Cloud 之配置中心
- iOS OpenCV 相机灰度处理
- Spring Cloud 之服务注册&发现
- LightOJ1020(简单博弈)
- 2039
- python 批量保存网页中的超链接网址源代码
- Spring Cloud 之服务网关
- 解决Android使用ScrollView和 ListView时底部空间随着输入法向上移动的问题
- 2040
- qrious.js实现在线生成二维码插件的使
- Spring Cloud 之负载均衡
- Robotframework环境搭建六:设置日志目录
- Spring Cloud 之断路器
- 2041