import requests from bs4 import BeautifulSoup import time import re t = 0 #用于给图片命名 for i in range(10): url = "https://list.jd.com/list.html?cat=9987,653,655&page=%s&sort=sort_rank_asc&trans=1&JL=6_0_0&ms=6#J_main"%i #起始url #设…
最近发现一个可以看图的地方,一张张翻有点累,毕竟只有一只手(难道鼠标还能两只手翻?).能不能下到电脑上看呢,毕竟不用等网速,还可以预览多张,总之很方便,想怎么就怎么,是吧? 刚好这几天在学python,刚好拿来试试手. 代码注释很详细就不做解释了.代码比较丑,有建议随便提,反正我也不改. import requests as re from bs4 import BeautifulSoup import os #import threading #定义一个爬去图片的类 class Spider:…
from urllib import requestimport re import osdef main(): #page=request.urlopen("http://image.baidu.com/search/index?tn=baiduimage&ipn=r&ct=201326592&cl=2&lm=-1&st=-1&fr=&sf=1&fmq=1461834053046_R&pv=&ic=0&nc…
python爬虫实战——图片自动下载器 之前介绍了那么多基本知识[Python爬虫]入门知识,(没看的先去看!!)大家也估计手痒了.想要实际做个小东西来看看,毕竟: talk is cheap show me the code! 这个小工程的代码都在github上,感兴趣的自己去下载: https://github.com/hk029/Pickup 制作爬虫的基本步骤 顺便通过这个小例子,可以掌握一些有关制作爬虫的基本的步骤. 一般来说,制作一个爬虫需要分以下几个步骤: 1. 分析需求(对,需求…