考拉熊 发表于 2018-10-27 10:59:16

python 爬取煎蛋妹子图片

本帖最后由 考拉熊 于 2018-10-29 11:06 编辑

前一段之间一直在网上找爬取煎蛋妹子的教程,

一直都是破解js加密算法后,回去到图片的真是url

后来通过模拟无头浏览器headless Chrome,
先下载谷歌无头浏览器(前提是自己要有谷歌浏览器)
https://pan.baidu.com/s/18-tGwpgOCvS6HntVdVyqrg
米码: 5x8j
将无头浏览器放置在自己的同级文件夹下面,
也可以了解他的功能https://www.jianshu.com/p/11d519e2d0cb

请求回来的网页会自动加载js文件后,通过正则分析出来图片URL,进行保存。

解决图片加密问题,


源代码如下
**** Hidden Message *****

考拉熊 发表于 2018-10-27 11:30:33

{:5_109:}

新体验 发表于 2018-10-27 13:19:19

haha1

1615598 发表于 2018-10-27 14:07:51

厉害!

Lawliet666 发表于 2018-10-27 14:35:24

羡慕

考拉熊 发表于 2018-10-27 14:36:17

1615598 发表于 2018-10-27 14:07
厉害!

我是初学者···互相学习

考拉熊 发表于 2018-10-27 14:36:56

Lawliet666 发表于 2018-10-27 14:35
羡慕

互相学习,共同进步{:5_109:}{:5_109:}

Lawliet666 发表于 2018-10-27 14:47:53

本帖最后由 Lawliet666 于 2018-10-27 14:49 编辑

================== RESTART: C:\Users\Desktop\新建文本文档.py ==================
Traceback (most recent call last):
File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 997, in _execute_child
    startupinfo)
FileNotFoundError: 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Desktop\新建文本文档.py", line 25, in <module>
    driver = webdriver.Chrome(chrome_options=chrome_options)
File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
File "C:\Users\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

>>> 我运行这个这样怎么回事{:10_266:}

Specter-U 发表于 2018-10-27 15:51:27

学习

考拉熊 发表于 2018-10-27 15:59:31

Lawliet666 发表于 2018-10-27 14:47
================== RESTART: C:%users\Desktop\新建文本文档.py ==================
Traceback (most rec ...

C:\ Users \ MI \ Desktop \ python \爬虫测试文件\煎蛋妹子\

这个是我的文件夹路径,
你的文件夹路径替换一下我这个就ok了

考拉熊 发表于 2018-10-27 16:22:30

Lawliet666 发表于 2018-10-27 14:47
================== RESTART: C:%users\Desktop\新建文本文档.py ==================
Traceback (most rec ...

已经做了修改,,可以重新复制跑

股灰 发表于 2018-10-27 19:20:58

每天学习一点点。

想抓兔子的云 发表于 2018-10-29 09:45:07

感谢分享

想抓兔子的云 发表于 2018-10-29 09:53:36

Traceback (most recent call last):
File "C:\Users\duhao\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
    stdin=PIPE)
File "C:\Users\duhao\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 947, in __init__
    restore_signals, start_new_session)
File "C:\Users\duhao\AppData\Local\Programs\Python\Python35-32\lib\subprocess.py", line 1224, in _execute_child
    startupinfo)
FileNotFoundError: 系统找不到指定的文件。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "E:/workspace/Exercise/jiandan.py", line 32, in <module>
    driver = webdriver.Chrome(chrome_options=chrome_options)
File "C:\Users\duhao\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
    self.service.start()
File "C:\Users\duhao\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\common\service.py", line 83, in start
    os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

考拉熊 发表于 2018-10-29 11:07:57

想抓兔子的云 发表于 2018-10-29 09:53


先下载谷歌无头浏览器(前提是自己要有谷歌浏览器)
https://pan.baidu.com/s/18-tGwpgOCvS6HntVdVyqrg
米码:5x8j
将无头浏览器放置在自己的同级文件夹下面,
也。可以了解他的功能https://www.jianshu.com/p/11d519e2d0cb

xiaodaidai1998 发表于 2018-10-29 15:40:58

666666666666666

YUANxin 发表于 2018-10-29 22:44:20

吱吱

沐锦风 发表于 2018-10-29 22:50:02

啊u的改革菲亚乌

python小白呀 发表于 2018-10-29 23:10:13

强呀

xtzyb 发表于 2018-10-29 23:40:30

呵呵
页: [1] 2 3 4 5 6 7
查看完整版本: python 爬取煎蛋妹子图片