1,MYSQL安裝與使用相關:
https://blog.csdn.net/qq_30336433/article/details/80037989 ? navicat注冊安裝和激活(驗證可行)
PyMySQL 是在 Python3.x 版本中用于連接 MySQL 服務器的一個庫,Python2中則使用mysqldb。
https://www.runoob.com/python3/python3-mysql.html ?Python3 MySQL 數(shù)據(jù)庫連接 - PyMySQL 驅動
https://www.runoob.com/python/python-mysql.html ? Python2 操作 MySQL 數(shù)據(jù)庫
"https://www.cnblogs.com/ziyoublog/p/9722849.html">MySQL下載安裝詳情教程
https://www.cnblogs.com/123hqb--/p/6181732.html ?MySQL數(shù)據(jù)庫的安裝與密碼配置?
輸入命令:cd D:\Program Files\JavaTool\MySQL\mysql-5.6.39-winx64\bin;進入mysql的bin文件夾(不管有沒有配置過環(huán)境變量,也要進入bin文件夾,否則之后啟動服務仍然會報錯誤2)
https://baijiahao.baidu.com/s?id=1624003274176404883&wfr=spider&for=pc ? mysql數(shù)據(jù)庫導入和導出
https://blog.csdn.net/shinny195/article/details/82319218 ?MySQL服務無法啟動,服務沒有報告任何錯誤,請鍵入 NET HELPMSG 3534 以獲得更多的幫助?
配置文件中路徑需要用\\不能使用\.我的default-storage-engine加這個配置會報錯,我就刪除了這個項。
注意:datadir屬性后的data文件夾,一定不要自己手動創(chuàng)建,本人嘗試手動創(chuàng)建會有問題,如果自己創(chuàng)建了可以刪除掉,再執(zhí)行后面的操作。
在mysql5.7以上版本中默認沒有一個data目錄,即沒有初始化服務。需要先初始化mysql才可以啟動服務,否則會報 “服務沒有報告任何錯誤”,啟動失敗。
解決方法:
a 進入mysql的bin目錄;
b 執(zhí)行mysqld ?--initialize-insecure ,第一次執(zhí)行的話,時間會久一些,執(zhí)行結束后沒有輸出信息,查看bin的同級目錄下會多出一個data文件夾,里面一堆文件。
https://blog.csdn.net/pdcfighting/article/details/85345540 ?MySQL服務正在啟動或停止中,請稍候片刻后再試一次【解決方案】
2,pyspider安裝與使用相關
C:\Windows\system32>pip install pyspider
? ? ERROR: Complete output from command python setup.py egg_info:
? ? ERROR: Please specify --curl-dir=/path/to/built/libcurl
? ? ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 10 in C:\Users\D\AppData\Local\Temp\pip-install-1t4tnfz6\pycurl\
https://www.cnblogs.com/lzhc/p/8343246.html ? python爬蟲框架(2)--PySpider框架安裝配置?
https://blog.csdn.net/shawroad88/article/details/82222811 ?解決安裝pyspider失敗:Command "python setup.py egg_info"failed with error code 10 in....
pip3 install wheel
pip3 --version ?看版本選擇:
pip3 install ?D:\learnsofeware\python3.7\pycurl-7.43.0.3-cp37-cp37m-win32.whl
pip3 install pyspider
C:\\Program Files (x86)\\Python37-32\\lib\\site-packages\\pyspider\\__init__.py
https://blog.csdn.net/weixin_41698864/article/details/89444910 ? python3.7啟動pyspider時報錯的問題 ?這個不知怎么改。
依下面 的改動,替換后,我的運行就正常了。
Python 3.5中引入了async和await,它們在Python 3.7中成為關鍵字。
所以需要替換一下關鍵字。在Python37\Lib\site-packages\pyspider目錄下run.py、tornado_fetcher.py、webui>app.py,ctrl+f查找async替換掉全部就可以了,可以用async1替換掉async。
原文:https://blog.csdn.net/u012424313/article/details/89511520?
但提示:result_worker starting 之后再無更多內容
命令行pyspider,之后一直卡在result_worker starting...
參考:https://segmentfault.com/q/1010000007682102/a-1020000007769713(把防火墻關了,以及再開一個cmd,運行pyspider,再關掉原來那個cmd)
https://www.cnblogs.com/wisir/p/10666185.html
ValueError: Invalid configuration:
- Deprecated option 'domaincontroller': use 'http_authenticator.domain_controller' instead.
參考:https://www.cnblogs.com/wisir/p/10587938.html
把
'domaincontroller': NeedAuthController(app),
修改為:
'http_authenticator':{
'HTTPAuthenticator':NeedAuthController(app),
},
Phantomjs.exe文件,拷貝到Python安裝目錄就行了。
http://localhost:5000
[E 160329 11:32:22 base_handler:194] HTTP 599: SSL certificate problem: self signed certificate in certificate chain
self.crawl('http://movie.douban.com/tag/', callback=self.index_page,validate_cert=False)
于是先git下來最新的pyspider源碼,把Python27\Lib\site-packages\pyspider-0.3.10.dev0-py2.7.egg目錄下的pyspider整個文件夾刪除,用git下的源碼里的pyspider整體復制過去,重啟pyspider all,再次瀏覽器中運行,成功!
phantomjs.exe 啟動時會打開端口25555,PYSPIDER 打開兩次時如果第一次的CMD窗口開著,則在然后第二次打開時后需要關掉第一個,第二個CMD才能正確打開端口。有時頁面也需要刷新下,否則總有599ERROR.
3,有時圖片不能加載的原因:有JS渲染:
self.crawl(each.attr.href, callback=self.detail_page, fetch_type='js')
4,爬蟲工作時如返回503錯誤,需要模擬一個訪問頭部:
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36"}
requests.get(url,,headers = headers)
更多文章、技術交流、商務合作、聯(lián)系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯(lián)系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
