我也搞了个抓淘宝 MM 的 py 程序

2017-03-31 13:22:58 +08:00
 carlonelong

我平时写后台的,看你们爬得高兴也来凑个热闹。 做得很粗糙,没有考虑出错恢复什么的,有时间再加吧。 地址是 https://github.com/carlonelong/TaobaoMMCrawler

5594 次点击
所在节点    Python
33 条回复
aksoft
2017-03-31 13:30:15 +08:00
这是抓啥的???
carlonelong
2017-03-31 14:00:17 +08:00
@aksoft mm 相册
RE
2017-03-31 14:20:17 +08:00
原来是抓淘女郎……
话说抓过某特定关键词的买家秀,惊喜多多… 楼主可以试试… 记住分类排除内衣的(不让上图
caicaicaiTrain
2017-03-31 14:24:08 +08:00
@RE 这个刺激了
mansur
2017-03-31 14:25:19 +08:00
能抓东京的大姐姐吗
springmarker
2017-03-31 14:35:54 +08:00
抓 cosplay 店的
carlonelong
2017-03-31 15:16:20 +08:00
@RE
来提供一个~~
carlonelong
2017-03-31 15:16:51 +08:00
@springmarker 有道理
tyhunter
2017-03-31 15:33:24 +08:00
报错了

start downloading 田媛媛
current page 1
start downloading album 10000702574 45ÕÅ 张
Traceback (most recent call last):
File "/Users/hunter/Downloads/TaobaoMMCrawler-master/crawler.py", line 83, in <module>
c.getAlbums()
File "/Users/hunter/Downloads/TaobaoMMCrawler-master/crawler.py", line 58, in getAlbums
self.getImages(model_id, album_id, album_img_count.strip(u'张'))
File "/Users/hunter/Downloads/TaobaoMMCrawler-master/crawler.py", line 65, in getImages
for page in xrange(1, (int(image_count)-1)/16+2):
ValueError: invalid literal for int() with base 10: '45\xd5\xc5'
carlonelong
2017-03-31 16:54:57 +08:00
@tyhunter 编码出问题了。。 你是啥环境啊
roist
2017-03-31 17:01:25 +08:00
美图秀秀修过度的图,不如看看那些国内的擦边套图
zwh8800
2017-03-31 17:12:37 +08:00
好像有 BUG 啊

```
$ python crawler.py
start downloading 田媛媛
current page 1
start downloading album 10000702574 45ÕÅ 张
Traceback (most recent call last):
File "crawler.py", line 83, in <module>
c.getAlbums()
File "crawler.py", line 58, in getAlbums
self.getImages(model_id, album_id, album_img_count.strip(u'张'))
File "crawler.py", line 65, in getImages
for page in xrange(1, (int(image_count)-1)/16+2):
ValueError: invalid literal for int() with base 10: '45\xd5\xc5'
```
123s
2017-03-31 17:18:34 +08:00
抓淘宝 MM
好 h
xiejc
2017-03-31 17:24:44 +08:00
41 行 soup = bs(self.readHtml(model_url).decode('gbk'), 'html.parser') 修改成功 不报错了
carlonelong
2017-03-31 17:26:35 +08:00
@xiejc 好 thx 我改一下
imherer
2017-03-31 17:29:31 +08:00
Python 版本要多少啊?
我 2.7 在 Mac 和 Windows 下都报同样的错呢
````
Traceback (most recent call last):
File "TaobaoMMCrawler.py", line 5, in <module>
from bs4 import BeautifulSoup as bs
ImportError: No module named bs4
````
zwh8800
2017-03-31 17:30:39 +08:00
@xiejc 👍
carlonelong
2017-03-31 17:32:50 +08:00
@imherer 这个是因为你没装 beautifulsoup pip install bs4 应该就可以了
7654
2017-03-31 17:52:22 +08:00
可以添加浏览器 UA
爬的时候限制一下,不然会 GG
neutrino
2017-03-31 17:58:07 +08:00
提了个 pr ,有些文件是 png 格式的(

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/351726

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX