
1 O21 OP =,= 写的有点乱。。新手,,请各位海涵~~ |
2 77421 Jul 14, 2014 用正则。。 |
4 izoabr Jul 14, 2014 为什么是3个引号? |
5 Fotix Jul 14, 2014 一看就是抓晒组的,果不其然 |
6 O21 OP |
8 paulw54jrn Jul 14, 2014 @O21 错误: IOError: [Errno 2] No such file or directory: u'/home/o21/\u6587\u6863/PythonEX/Doubanimg/p1616253.jpg' 检查下Unicode的问题 |
9 O21 OP @izoabr 我这样写了。 img_LuJ = raw_input("路径:".decode('utf-8')) download_img = urllib.urlretrieve(imgurl,img_LuJ + '/%s.jpg'%img_num) 然后报错 IOError: [Errno 2] No such file or directory: u'/home/o21/img/p1611237.jpg' |
10 paulw54jrn Jul 14, 2014 把下载路径改成 '/tmp/%s.jpg' % img_num 用做测试的话,程序可以跑起来 paul@PaulMBP:~/Desktop$ ipython test.py ################################################## 本程序主要采集豆瓣<请不要害羞>小组的图片 ################################################## 采集前需要输入代理服务器地址,这样可以防止被豆瓣屏蔽. 推荐一个代理地址: http://cn-proxy.com/ 只需要输入服务器地址以及端口号,不需要输入http 例子:127.0.0.1:8080 ################################################## 请输入采集代理服务器:121.10.120.135:8001 请输入采集页码数:1 http://img3.douban.com/view/group_topic/large/public/p16112371.jpg http://img3.douban.com/view/group_topic/large/public/p16112380.jpg 程序采集完成 |
11 O21 OP @paulw54jrn 我这次木有用中文,也报错。。我楼上写了。。 很郁闷。 |
12 paulw54jrn Jul 14, 2014 这样试试? file = "/home/o21/img/%s.jpg" % img_num try: download_img = urllib.urlretrieve(imgurl,file) except IOError: os.mkdir(file.[:file.rfind("/")]) |
13 paulw54jrn Jul 14, 2014 唔..偷懒没用gist.. 缩进乱了..不过你懂的.. |
14 kawaiiushio Jul 15, 2014 求成品分享 |
15 O21 OP @kawaiiushio 在这里下载吧 HOHO http://162.244.92.122/DouBanMZ.zip |
16 WhyLiam Jul 15, 2014 和我一样,我也前天写了抓 害羞组 图片的程序。同道中人啊 但是写的比你简单多了。。。 已经抓了近1700页了 |
17 eslizn Jul 15, 2014 我是来看害羞组的 |
18 C0VN Jul 15, 2014 |
19 puyo Jul 15, 2014 可以加入多线程,速度要快一些。 |
20 dingyaguang117 Jul 15, 2014 至少 socket 的timeout 要加吧,不然死都不知道怎么死的 |
21 sujin190 Jul 15, 2014 看来写过多注释也有不利的时候。。 |
22 shyrock Jul 15, 2014 请教解决中文报错那段是啥意思? |
23 horizon Aug 1, 2014 为什么要用代理?在header里直接加入cookies就可以了啊 |