網絡上安裝pyspider的坑有很多,但都不如我今天的大,困擾了我幾天,終於解決了
Traceback (most recent call last): File "/ffk_learn/software/Python-3.7.0/ffk_py/bin/pyspider", line 7, in <module> from pyspider.run import main File "/ffk_learn/software/Python-3.7.0/ffk_py/lib/python3.7/site-packages/pyspider/run.py", line 231 async=True, get_object=False, no_input=False): ^ SyntaxError: invalid syntax
一直抱着個錯誤,后來才發現,是因為async從python3.7開始不能用作參數名了,將所有腳本里面的async換一個名字即可,當然最好還是要pyspider的大佬更新下pyspider.腳本不多,一共兩個腳本
1 ffk_py/lib/python3.7/site-packages/pyspider/run.py
2 ffk_py/lib/python3.7/site-packages/pyspider/fetcher/tornado_fetcher.py
ValueError: Invalid configuration: - Deprecated option 'domaincontroller': use 'http_authenticator
安裝完爬蟲框架pyspider之后,使用pyspider all 命令,輸入http://localhost:5000運行就出現上述錯誤
原因是因為WsgiDAV發布了版本 pre-release 3.x。
解決方法如下:
在安裝包中找到pyspider的資源包,然后找到webui文件里面的webdav.py文件打開,修改第209行即可。
把
'domaincontroller': NeedAuthController(app),
修改為:
'http_authenticator':{ 'HTTPAuthenticator':NeedAuthController(app), },
然后再執行pyspider all就能夠通過http://localhost:5000打開頁面了。