python学习之旅-爬虫
来源:互联网 发布:java防止页面脚本注入 编辑:程序博客网 时间:2024/04/24 09:06
# -*- coding: utf-8 -*-"""Spyder EditorThis is a temporary script file."""import reimport urllib.requestdef getHtml(url): page = urllib.request.urlopen(url) html = page.read() return htmldef getImg(html): html = html.decode('utf_8') reg = r'src="(.*?\.jpg)" width' imgre = re.compile(reg) imglist = imgre.findall(html) return imglisthtml = getHtml('https://movie.douban.com/')x = 0for imgurl in getImg(html): urllib.request.urlretrieve(imgurl,'%s.jpg' % x) x += 1print(getImg(html))
阅读全文
0 0
- python学习之旅-爬虫
- 学习Python之爬虫1
- Python爬虫之框架学习
- python学习之网络爬虫
- 爬虫学习之旅
- python网络爬虫学习笔记之实力爬虫(
- 开启python爬虫之旅
- Python学习—网络爬虫之OJ
- python学习之简单正则与爬虫
- python爬虫学习之抓取一个页面
- 学习Python之网络爬虫(一)
- python网络爬虫学习之路
- Python爬虫学习之Selenium详解
- Python爬虫学习之常用技巧详解
- Python爬虫学习之爬美女图片
- Python爬虫学习笔记之基础知识
- Python学习笔记之简单爬虫
- python爬虫学习之Soup模块
- 用node来调用自定义模块
- vue-cli node-sass安装问题
- tensorflow: variable初始化
- 常用Android开发软件介绍
- Java篇--抽象类和接口
- python学习之旅-爬虫
- mysql5.7group by异常引发的思考
- javascript
- JAVA Spring 第一课
- YII2框架学习 安全篇(四) sql注入攻击和防范
- 什么是伪代码?
- 恩典与道德的区别
- mybatis自动生成sql变量及批量insert限制
- BIOS界面开启VT教程