網(wǎng)站性能檢測評分
注:本網(wǎng)站頁面html檢測工具掃描網(wǎng)站中存在的基本問題,僅供參考。
python能做什么知乎
如何抓取這些網(wǎng)站數(shù)據(jù)?python源碼大全,包括微信,知乎。QQ,豆瓣,天貓京東等 流量視頻課程
WechatSogou[1]- 微信公眾號爬蟲?;谒压肺⑿潘阉鞯奈⑿殴娞柵老x接口,可以擴展成基于搜狗搜索的爬蟲,返回結(jié)果是列表,每一項均是公眾號具體信息字典。[1]: https://github/Chyroc/WechatSogou
DouBanSpider[2]- 豆瓣讀書爬蟲??梢耘老露拱曜x書標簽下的所有圖書,按評分排名依次存儲,存儲到Excel中,可方便大家篩選搜羅,比如篩選評價人數(shù)>1000的高分書籍;可依據(jù)不同的主題存儲到Excel不同的Sheet ,采用User Agent偽裝為瀏覽器進行爬取,并加入隨機延時來更好的模仿瀏覽器行為,避免爬蟲被封。[2]: https://github/lanbing510/DouBanSpider
zhihu_spider[3]- 知乎爬蟲。此項目的功能是爬取知乎用戶信息以及人際拓撲關(guān)系,爬蟲框架使用scrapy,數(shù)據(jù)存儲使用mongodb。[3]: https://github/LiuRoy/zhihu_spider
bilibili-user[4]- Bilibili用戶爬蟲。總數(shù)據(jù)數(shù):20119918,抓取字段:用戶id,昵稱,性別,頭像,等級,經(jīng)驗值,粉絲數(shù),生日,地址,注冊時間,簽名,等級與經(jīng)驗值等。抓取之后生成B站用戶數(shù)據(jù)報告。[4]: https://github/airingursb/bilibili-user
SinaSpider[5]- 新浪微博爬蟲。主要爬取新浪微博用戶的個人信息、微博信息、粉絲和關(guān)注。代碼獲取新浪微博Cookie進行登錄,可通過多賬號登錄來防止新浪的反扒。主要使用 scrapy 爬蟲框架。[5]: https://github/LiuXingMing/SinaSpider
distribute_crawler[6]- 小說下載分布式爬蟲。使用scrapy,redis, mongodb,graphite實現(xiàn)的一個分布式網(wǎng)絡(luò)爬蟲,底層存儲mongodb集群,分布式使用redis實現(xiàn),爬蟲狀態(tài)顯示使用graphite實現(xiàn),主要針對一個小說站點。[6]: https://github/gnemoug/distribute_crawler
CnkiSpider[7]- 中國知網(wǎng)爬蟲。設(shè)置檢索條件后,執(zhí)行src/CnkiSpider.py抓取數(shù)據(jù),抓取數(shù)據(jù)存儲在/data目錄下,每個數(shù)據(jù)文件的第一行為字段名稱。[7]: https://github/yanzhou/CnkiSpider
LianJiaSpider[8]- 鏈家網(wǎng)爬蟲。爬取北京地區(qū)鏈家歷年二手房成交記錄。涵蓋鏈家爬蟲一文的全部代碼,包括鏈家模擬登錄代碼。[8]: https://github/lanbing510/LianJiaSpider
scrapy_jingdong[9]- 京東爬蟲。基于scrapy的京東網(wǎng)站爬蟲,保存格式為csv。[9]: https://github/taizilongxu/scrapy_jingdong
QQ-Groups-Spider[10]- QQ 群爬蟲。批量抓取 QQ 群信息,包括群名稱、群號、群人數(shù)、群主、群簡介等內(nèi)容,最終生成 XLS(X) / CSV 結(jié)果文件。[10]: https://github/caspartse/QQ-Groups-Spider
wooyun_public[11]-烏云爬蟲。 烏云公開漏洞、知識庫爬蟲和搜索。全部公開漏洞的列表和每個漏洞的文本內(nèi)容存在mongodb中,大概約2G內(nèi)容;如果整站爬全部文本和圖片作為離線查詢,大概需要10G空間、2小時(10M電信帶寬);爬取全部知識庫,總共約500M空間。漏洞搜索使用了Flask作為web server,bootstrap作為前端。[11]: https://github/hanc00l/wooyun_public
QunarSpider[12]- 去哪兒網(wǎng)爬蟲。 網(wǎng)絡(luò)爬蟲之Selenium使用代理登陸:爬取去哪兒網(wǎng)站,使用selenium模擬瀏覽器登陸,獲取翻頁操作。代理可以存入一個文件,程序讀取并使用。支持多進程抓取。[12]: https://github/lining0806/QunarSpider
findtrip[13]- 機票爬蟲(去哪兒和攜程網(wǎng))。Findtrip是一個基于Scrapy的機票爬蟲,目前整合了國內(nèi)兩大機票網(wǎng)站(去哪兒 + 攜程)。[13]: https://github/fankcoder/findtrip
163spider[14] - 基于requests、MySQLdb、torndb的網(wǎng)易客戶端內(nèi)容爬蟲。[14]: https://github/leyle/163spider
doubanspiders[15]- 豆瓣電影、書籍、小組、相冊、東西等爬蟲集。[15]: https://github/dontcontactme/doubanspiders
QQSpider[16]- QQ空間爬蟲,包括日志、說說、個人信息等,一天可抓取 400 萬條數(shù)據(jù)。[16]:https://github/LiuXingMing/QQSpider
baidu-music-spider[17]- 百度mp3全站爬蟲,使用redis支持斷點續(xù)傳。[17]: https://github/Shu-Ji/baidu-music-spider
tbcrawler[18]- 淘寶和天貓的爬蟲,可以根據(jù)搜索關(guān)鍵詞,物品id來抓去頁面的信息,數(shù)據(jù)存儲在mongodb。[18]: https://github/pakoo/tbcrawler
stockholm[19]- 一個股票數(shù)據(jù)(滬深)爬蟲和選股策略測試框架。根據(jù)選定的日期范圍抓取所有滬深兩市股票的行情數(shù)據(jù)。支持使用表達式定義選股策略。支持多線程處理。保存數(shù)據(jù)到JSON文件、CSV文件。[19]https://github/benitoro/stockholm
最全知乎專欄合集:python、爬蟲、數(shù)據(jù)分析、挖掘、ML、NLP、DL 互聯(lián)網(wǎng)視頻課程
上一篇文章《爬取11088個知乎專欄,打破發(fā)現(xiàn)壁壘》里提到,知乎官方?jīng)]有搜素專欄的功能,于是我通過爬取幾十萬用戶個人主頁所專注的專欄從而獲取到11088個知乎專欄。
本回篩選出其中涉及:編程、python、爬蟲、數(shù)據(jù)分析、挖掘、ML、NLP、DL等關(guān)鍵詞的專欄,按照排名、關(guān)注人數(shù)、專欄名稱、專欄簡介等順序,羅列出史上最全專欄合集,以供大家順藤摸瓜、前去觀摩和學習。
篩選出來的專欄數(shù)據(jù)和全部11088個專欄數(shù)據(jù),評論區(qū)有獲取方式。對其他主題的專欄感興趣的可自行去搜尋,有興致搞出個“專欄”搜索功能的小伙伴也可以嘗試下!
另外已開始對11088個專欄里的數(shù)據(jù)進行進一步爬取,之后會繼續(xù)相關(guān)分析和資源分享。
TOP29系列,1萬+關(guān)注:
No.1, 157960, 數(shù)據(jù)冰山, https://zhuanlan.zhihu/hemingke
(No.2, 112088,學習編程,莫道君行早,更有早行人。全心敲代碼,天道自酬勤)(不小心漏了TOP2專欄,簡直蠢哭)
No.2, 62106, 行為與認知神經(jīng)科學, https://zhuanlan.zhihu/ibrain
No.3, 50136, 機器之心, https://zhuanlan.zhihu/jiqizhixin
No.4, 37234, 企業(yè)分析, https://zhuanlan.zhihu/company-research
No.5, 35642, 挖掘知乎里有趣的東西, https://zhuanlan.zhihu/grapeot
No.6, 34389, 智能單元, https://zhuanlan.zhihu/intelligentunit
No.7, 31283, Python中文社區(qū), https://zhuanlan.zhihu/zimei
No.8, 28949, Python之美, https://zhuanlan.zhihu/python-cn
No.9, 24053, 地圖、地理與區(qū)域, https://zhuanlan.zhihu/geo-space
No.10, 21719, Moneycode, https://zhuanlan.zhihu/ricequant
No.11, 21586, vn.py, https://zhuanlan.zhihu/vn-py
No.12, 21581, 黑客與畫家, https://zhuanlan.zhihu/hacker-and-painter
No.13, 21522, 面向工資編程, https://zhuanlan.zhihu/auxten
No.14, 21042, 編程語言與高級語言虛擬機雜談(仮), https://zhuanlan.zhihu/hllvm
No.15, 18786, 深度學習大講堂, https://zhuanlan.zhihu/dlclass
No.16, 17957, BitTiger.io, https://zhuanlan.zhihu/bittiger
No.17, 16257, 一起學習python網(wǎng)絡(luò)爬蟲, https://zhuanlan.zhihu/gooseeker
No.18, 15751, 數(shù)據(jù)分析俠, https://zhuanlan.zhihu/dataman
No.19, 14847, 做游戲,學編程(C語言), https://zhuanlan.zhihu/c2game
No.20, 14792, 數(shù)據(jù)時光機, https://zhuanlan.zhihu/washu
No.21, 12908, 不宜公開, https://zhuanlan.zhihu/xiaoliangshan
No.22, 12606, Jiang的金融窩, https://zhuanlan.zhihu/quantjiang
No.23, 12131, 無痛的機器學習, https://zhuanlan.zhihu/hsmyy
No.24, 11635, 新一線城市研究所, https://zhuanlan.zhihu/therisinglab
No.25, 11629, Crossin的編程教室, https://zhuanlan.zhihu/crossin
No.26, 11012, 一個數(shù)據(jù)分析師的自我修養(yǎng), https://zhuanlan.zhihu/data-analyst-improvement
No.27, 10932, Hello 陳然!, https://zhuanlan.zhihu/chenran
No.28, 10619, 爬蟲之從入門到精通, https://zhuanlan.zhihu/pachong
No.29, 10254, Data Science with R&Python, https://zhuanlan.zhihu/rdatamining
5千+關(guān)注:
No.30, 9969, 集智, https://zhuanlan.zhihu/c_81843036
No.31, 9127, PRML, https://zhuanlan.zhihu/prml-paper-reading
No.32, 8568, 量化哥, https://zhuanlan.zhihu/uqer2015
No.33, 8515, AI學人, https://zhuanlan.zhihu/aixueren
No.34, 8114, 數(shù)據(jù)驅(qū)動業(yè)務增長, https://zhuanlan.zhihu/growingio
No.35, 7820, 前端周刊, https://zhuanlan.zhihu/feweekly
No.36, 7790, Analytics at Work, https://zhuanlan.zhihu/analyticsatwork
No.37, 7745, R語言中文社區(qū), https://zhuanlan.zhihu/rshequ
No.38, 6957, Python 與 機器學習, https://zhuanlan.zhihu/carefree0910-pyml
No.39, 6944, 超智能體, https://zhuanlan.zhihu/YJango
No.40, 6842, 大數(shù)據(jù)分析挖掘, https://zhuanlan.zhihu/hellobi
No.41, 6823, 技術(shù)備忘錄, https://zhuanlan.zhihu/mathNote
No.42, 6775, Hic Rhodus, hic salta, https://zhuanlan.zhihu/HicRhodushicsalta
No.43, 6753, 機器學習算法與自然語言處理, https://zhuanlan.zhihu/qinlibo-ml
No.44, 6700, 科技蟹, https://zhuanlan.zhihu/kejixie
No.45, 6641, 某熊的全棧之路, https://zhuanlan.zhihu/wxyyxc1992
No.46, 6559, 風險狗的數(shù)據(jù)分析之路, https://zhuanlan.zhihu/loan-analytics
No.47, 6328, Joe's Studio & Cafe, https://zhuanlan.zhihu/hijoe
No.48, 6222, 菜鳥學數(shù)據(jù)挖掘, https://zhuanlan.zhihu/datanalysis
No.49, 5438, Python之禪, https://zhuanlan.zhihu/pythoneer
No.50, 5391, 混沌巡洋艦, https://zhuanlan.zhihu/c_29122335
No.51, 5241, R語言數(shù)據(jù)分析與可視化, https://zhuanlan.zhihu/EasyCharts-R
No.52, 5224, 數(shù)據(jù)分析網(wǎng), https://zhuanlan.zhihu/afenxi
No.53, 5218, Python高薪訓練營, https://zhuanlan.zhihu/c_111369541
No.54, 5171, 福山·雅·致, https://zhuanlan.zhihu/heziyin
No.55, 5100, 曉雷機器學習筆記, https://zhuanlan.zhihu/xiaoleimlnote
No.56, 5072, AI Insight, https://zhuanlan.zhihu/ai-insight
No.57, 5064, PYTHON挖掘機, https://zhuanlan.zhihu/python-excavator
No.58, 5051, Hello, Flask!, https://zhuanlan.zhihu/flask
1千+關(guān)注:
No.59, 4882, 機器學習 & 金融量化分析, https://zhuanlan.zhihu/jjscience
No.60, 4754, 自學游戲開發(fā), https://zhuanlan.zhihu/studygame
No.61, 4674, 前端之巔, https://zhuanlan.zhihu/qianduanzhidian
No.62, 4609, 集智·人工智能招聘, https://zhuanlan.zhihu/qiuneitui
No.63, 4600, Python爬蟲實戰(zhàn), https://zhuanlan.zhihu/pythoncrawl
No.64, 4566, Python Hacker, https://zhuanlan.zhihu/python-hacker
No.65, 4494, 煉丹實驗室, https://zhuanlan.zhihu/easyml
No.66, 4445, LeanReact, https://zhuanlan.zhihu/leanreact
No.67, 4410, 深度煉丹, https://zhuanlan.zhihu/c_94953554
No.68, 4217, 簡快Excel之PowerBI建模分析, https://zhuanlan.zhihu/leigongzi
No.69, 4132, [運籌帷幄]大數(shù)據(jù)和人工智能時代下的運籌學, https://zhuanlan.zhihu/operations-research
No.70, 4067, 深度學習:從入門到放棄, https://zhuanlan.zhihu/startdl
No.71, 4001, 天善智能, https://zhuanlan.zhihu/tianshansoft
No.72, 3937, 數(shù)據(jù)化管理, https://zhuanlan.zhihu/dataware
No.73, 3934, 開始學習機器人, https://zhuanlan.zhihu/learn-robotics
No.74, 3886, 強化學習知識大講堂, https://zhuanlan.zhihu/sharerl
No.75, 3796, 淺墨的游戲編程, https://zhuanlan.zhihu/game-programming
No.76, 3747, 莫煩, https://zhuanlan.zhihu/morvan
No.77, 3745, 高中文綜實驗室, https://zhuanlan.zhihu/liberart-Lab
No.78, 3738, Data Science, https://zhuanlan.zhihu/gongwenjia
No.79, 3685, 建筑可視化設(shè)計, https://zhuanlan.zhihu/uzing
No.80, 3673, MySQL, https://zhuanlan.zhihu/mysql
No.81, 3599, 備戰(zhàn)考研, https://zhuanlan.zhihu/SunLifeDreamer
No.82, 3590, Python程序員, https://zhuanlan.zhihu/pythoncxy
No.83, 3575, 從零開始寫Python爬蟲, https://zhuanlan.zhihu/Ehco-python
No.84, 3564, 靈的隨筆記, https://zhuanlan.zhihu/ZeitMark
No.85, 3532, 萌新的學習日記, https://zhuanlan.zhihu/linjichu
No.86, 3526, 李彬教你考注會, https://zhuanlan.zhihu/c_77735210
No.87, 3517, 鋼筆愛好者, https://zhuanlan.zhihu/v2bber
No.88, 3449, 管中窺豹, https://zhuanlan.zhihu/whiteheart
No.89, 3402, 智能水桶, https://zhuanlan.zhihu/smartspew
No.90, 3399, 數(shù)據(jù)是個錘子, https://zhuanlan.zhihu/datahammer
No.91, 3346, Python學習之路, https://zhuanlan.zhihu/python-kivy
No.92, 3302, 數(shù)據(jù)分析師的成長之路, https://zhuanlan.zhihu/datamap
No.93, 3221, Runtime, https://zhuanlan.zhihu/chenjiadong
No.94, 3220, 點點墨, https://zhuanlan.zhihu/junmo520
No.95, 3202, TOMsInsight, https://zhuanlan.zhihu/tomsinsight
No.96, 3170, 什么值得爬, https://zhuanlan.zhihu/c_80099524
No.97, 3118, 半個量化交易員, https://zhuanlan.zhihu/semi-quant-trader
No.98, 3104, 日積跬步, https://zhuanlan.zhihu/improve365
No.99, 3102, gluon, https://zhuanlan.zhihu/gluon
No.100, 3071, 蛇之魅惑, https://zhuanlan.zhihu/python-dev
No.101, 3058, Linux, https://zhuanlan.zhihu/LearningLinux
No.102, 3050, 馬志峰的編程筆記, https://zhuanlan.zhihu/mazhifeng
No.103, 3036, DT新紀元, https://zhuanlan.zhihu/dteratech
No.104, 3012, 原點實驗室, https://zhuanlan.zhihu/cndatalab
No.105, 2912, 分布式筆記, https://zhuanlan.zhihu/b-tree
No.106, 2876, 2gua的編程生活, https://zhuanlan.zhihu/guagua
No.107, 2827, 寫點Python, https://zhuanlan.zhihu/something-python
No.108, 2811, 撩撩數(shù)據(jù)吧, https://zhuanlan.zhihu/jiago
No.109, 2805, 非凸優(yōu)化學習之路, https://zhuanlan.zhihu/optimization
No.110, 2786, Revit 專欄, https://zhuanlan.zhihu/RevitForum
No.111, 2755, VV Data Science, https://zhuanlan.zhihu/vieplivee
No.112, 2740, DαΓαSciεηce, https://zhuanlan.zhihu/datascience
No.113, 2700, 友盟專欄, https://zhuanlan.zhihu/umeng
No.114, 2685, 無人機日常, https://zhuanlan.zhihu/uavsdaily
No.115, 2668, 有意思的數(shù)據(jù)挖掘, https://zhuanlan.zhihu/data-mining
No.116, 2668, DT財經(jīng), https://zhuanlan.zhihu/dtcaijing
No.117, 2654, 人工智能學習筆記, https://zhuanlan.zhihu/c_80412427
No.118, 2553, Still的數(shù)據(jù)分析筆記, https://zhuanlan.zhihu/DataScientist
No.119, 2548, 人工智能應用系列, https://zhuanlan.zhihu/ai4application
No.120, 2464, 清雨的 Data Science 筆記, https://zhuanlan.zhihu/TsingJyuData
No.121, 2396, 帆軟數(shù)據(jù)應用研究院, https://zhuanlan.zhihu/fanruan
No.122, 2383, 數(shù)據(jù)黑板, https://zhuanlan.zhihu/data-factory
No.123, 2299, 諸葛io, https://zhuanlan.zhihu/zhugeio
No.124, 2255, golang數(shù)據(jù)結(jié)構(gòu)內(nèi)部實現(xiàn), https://zhuanlan.zhihu/goroutine
No.125, 2236, 數(shù)據(jù)可視化, https://zhuanlan.zhihu/datavis
No.126, 2206, Python高手之路, https://zhuanlan.zhihu/mingxinglai
No.127, 2181, Excel圖表之道, https://zhuanlan.zhihu/ExcelPro
No.128, 2162, 設(shè)計與人工智能, https://zhuanlan.zhihu/designintelligence
No.129, 2157, 機器人開發(fā)的那些事, https://zhuanlan.zhihu/c_32667517
No.130, 2145, 不動點高校現(xiàn)充部, https://zhuanlan.zhihu/fixpoint-high-school
No.131, 2144, Swift, https://zhuanlan.zhihu/swift
No.132, 2132, 大數(shù)據(jù)技術(shù)與實踐, https://zhuanlan.zhihu/hadoop
No.133, 2121, 繆斯夫人, https://zhuanlan.zhihu/msmueses
No.134, 2120, 小X的互聯(lián)網(wǎng)投資, https://zhuanlan.zhihu/thanksalot
No.135, 2108, 計算主義, https://zhuanlan.zhihu/pillgrim
No.136, 2080, 深海遨游, https://zhuanlan.zhihu/deeplearning-surfing
No.137, 2032, 我的JA♂VA日記, https://zhuanlan.zhihu/JAVAShinNippori
No.138, 2022, Python庫學習之路, https://zhuanlan.zhihu/pystudy
No.139, 2005, 人工智能+機器學習+深度學習技術(shù)文章精選, https://zhuanlan.zhihu/c_86691882
No.140, 1990, 邊城的編程, https://zhuanlan.zhihu/cold-code
No.141, 1987, 寫給妹子的深度學習教程, https://zhuanlan.zhihu/dlgirls
No.142, 1942, 機器有顆玻璃心, https://zhuanlan.zhihu/wjdml
No.143, 1936, 信號處理與機器學習, https://zhuanlan.zhihu/aresmiki
No.144, 1933, 中低頻量化交易與AI, https://zhuanlan.zhihu/quantwithAI
No.145, 1894, 文因互聯(lián), https://zhuanlan.zhihu/c_45652868
No.146, 1889, 文藝碼農(nóng)之家, https://zhuanlan.zhihu/elegant
No.147, 1859, 一圖一書, https://zhuanlan.zhihu/yituyishu
No.148, 1858, 一周一paper, https://zhuanlan.zhihu/one-paper-a-week
No.149, 1845, Python 爬蟲實戰(zhàn)日記, https://zhuanlan.zhihu/Waking-up
No.150, 1838, 片上神經(jīng)網(wǎng)絡(luò), https://zhuanlan.zhihu/DNN-on-Chip
No.151, 1832, Take AI Seriously, https://zhuanlan.zhihu/aifirst
No.152, 1798, Python開發(fā)微信公眾號, https://zhuanlan.zhihu/sufaith
No.153, 1725, excel講堂, https://zhuanlan.zhihu/excelskills
No.154, 1721, 販賣集裝箱的汽車大師, https://zhuanlan.zhihu/cantonax
No.155, 1719, 面試常見算法80題, https://zhuanlan.zhihu/80algorithms
No.156, 1703, 理論與機器學習, https://zhuanlan.zhihu/theoretical-machine-learning
No.157, 1703, 無線技術(shù)大講堂, https://zhuanlan.zhihu/dot11
No.158, 1688, 網(wǎng)絡(luò)高并發(fā)編程, https://zhuanlan.zhihu/yedongfu
No.159, 1658, Python數(shù)據(jù)采集處理分析挖掘可視化應用實例, https://zhuanlan.zhihu/boken
No.160, 1655, Scratch編程, https://zhuanlan.zhihu/scratch
No.161, 1642, 小石頭的碼瘋窩, https://zhuanlan.zhihu/burness-DL
No.162, 1620, 「數(shù)據(jù)科學」思維導圖筆記, https://zhuanlan.zhihu/woaielf
No.163, 1614, 機器人的那些事, https://zhuanlan.zhihu/cobot
No.164, 1592, 數(shù)據(jù)結(jié)構(gòu)與算法, https://zhuanlan.zhihu/DataStructureAndAlgorithm
No.165, 1588, 紐扣數(shù)據(jù), https://zhuanlan.zhihu/niucodata
No.166, 1586, AI+設(shè)計, https://zhuanlan.zhihu/AIdesign
No.167, 1572, 我的java學習之路及習慣, https://zhuanlan.zhihu/c_120823325
No.168, 1564, 杠桿游戲, https://zhuanlan.zhihu/gangganyouxi
No.169, 1559, 飛總的IT世界面面觀, https://zhuanlan.zhihu/feizong
No.170, 1554, 數(shù)據(jù)應用學院, https://zhuanlan.zhihu/c_60877174
No.171, 1548, 上善若水——游戲公司財務檔案, https://zhuanlan.zhihu/hai1900
No.172, 1536, xTechDay, https://zhuanlan.zhihu/xTechDay
No.173, 1478, 簡單易懂的Python, https://zhuanlan.zhihu/easypython
No.174, 1471, 機器不學習, https://zhuanlan.zhihu/zhaoyeyu
No.175, 1429, 神經(jīng)網(wǎng)絡(luò)與強化學習, https://zhuanlan.zhihu/c_101836530
No.176, 1424, DL(Deep Learning)小記, https://zhuanlan.zhihu/Charles-Wang
No.177, 1413, 娛樂硬糖, https://zhuanlan.zhihu/yuleyingtang
No.178, 1401, 數(shù)據(jù)科學沉思錄, https://zhuanlan.zhihu/data-science-meditation
No.179, 1395, 前端小記, https://zhuanlan.zhihu/qianduan
No.180, 1386, 高斯世界下的Machine Learning, https://zhuanlan.zhihu/gpml2016
No.181, 1368, 聲學與人工智能, https://zhuanlan.zhihu/chenxl
No.182, 1362, 機器鼓勵師手冊, https://zhuanlan.zhihu/Stark
No.183, 1361, Udacity | 優(yōu)達學習筆記, https://zhuanlan.zhihu/youdanote
No.184, 1361, 諸事無常,唯死亡與稅永恒, https://zhuanlan.zhihu/c_86275978
No.185, 1348, 山人.七-深度學習, https://zhuanlan.zhihu/shanren7
No.186, 1338, 大數(shù)據(jù)Spark, https://zhuanlan.zhihu/bigdata-spark...
python3網(wǎng)絡(luò)爬蟲 (6)-分析知乎問題頁面數(shù)據(jù) 流量視頻課程
注:本文只做數(shù)據(jù)來源分析,暫未抓取數(shù)據(jù)
1. 打開知乎頁面(地址來自上次爬蟲爬取的數(shù)據(jù))
示例: https://zhihu/question/41508191
2. 打開可以看到需要抓取的數(shù)據(jù)有(標簽、標題、描述、答案)
頁面
3. 查看網(wǎng)頁請求狀況(由于該問題答案較少,暫時用 https://zhihu/question/65381487 查看接口數(shù)據(jù))
可以發(fā)現(xiàn)答案的接口。(還有相似問題和相關(guān)live,暫時沒有用到)
查看接口
4. 由于我們請求到的網(wǎng)頁中的js是不會執(zhí)行的,所以我們先禁用瀏覽器js(js禁用方法,請自行百度)
禁用js后的頁面
5. 接口只能看到答案,所以我們還需要在頁面上找到其他數(shù)據(jù)
經(jīng)過對比發(fā)現(xiàn),js執(zhí)行過的描述是有圖片的,但是js未執(zhí)行的沒有圖片,描述不夠完整。
但是沒有描述的請求,所以,猜測描述被隱藏在了頁面的其他地方
搜索中的描述部分內(nèi)容,可以發(fā)現(xiàn)確實被隱藏在了標簽中
6. 將描述內(nèi)容格式化
格式化后發(fā)現(xiàn),需要獲取的標簽、標題、描述等信息均在里面,不用再去網(wǎng)站上查找其他接口
格式化數(shù)據(jù)
喜歡就點個贊吧!
基于python的知乎開源爬蟲 zhihu 行業(yè)視頻課程
今天在無意之中發(fā)現(xiàn)了一個知乎的開源爬蟲,是基于Python的,名字叫zhihu_oauth,看了一下在github上面star數(shù)還挺多的,貌似文檔也挺詳細的,于是就稍微研究了一下。發(fā)現(xiàn)果然很好用啊。就在這里給大家介紹一下如何使用。
項目的主頁地址在:https://github/7sDream/zhihu-oauth。作者的知乎主頁為:https://zhihu/people/7sdream/。
項目的文檔地址為:http://zhihu-oauth.readthedocs.io/zh_CN/latest/index.html 。講道理,原作者對于該怎么使用這個庫已經(jīng)講的非常詳細了,我在這里再重復一遍簡直就是畫蛇添足。所以大家要是想詳細了解這個庫怎么用,就去官方文檔吧。我只說一下我覺得需要補充的重要的幾點。
首先是安裝。作者已經(jīng)將項目上傳到pypi了,所以我們可以直接使用pip進行安裝了。按照作者的說法,項目對于Python3的支持更好,淡然目前也是兼容Python2的,所以大家最好使用python3.直接 pip3 install -U zhihu_oauth 即可安裝。
安裝好了第一步就是登陸。直接使用下面的代碼就可以登陸。1 from zhihu_oauth import ZhihuClient 2 from zhihu_oauth.exception import NeedCaptchaException 3 client = ZhihuClient 4 user = 'email_or_phone' 5 pwd = 'password' 6 try: 7 client.login(user, pwd) 8 print(u"登陸成功!") 9 except NeedCaptchaException: # 處理要驗證碼的情況 10 # 保存驗證碼并提示輸入,重新登錄 11 with open('a.gif', 'wb') as f: 12 f.write(client.get_captcha) 13 captcha = input('please input captcha:') 14 client.login('email_or_phone', 'password', captcha) 15 16 client.save_token('token.pkl') # 保存token 17 #有了token之后,下次登錄就可以直接加載token文件了 18 # client.load_token('filename')
上面的代碼是直接使用賬號密碼登陸,最后保存了登陸之后的token,在下次登錄的時候我們就可以直接使用token登錄而不用每次都輸入密碼了。
在登錄完成之后,可以干的事情當然就很多了,比如下面的代碼就可以獲得自己的知乎賬戶的基本信息1 from __future__ import print_function # 使用python3的print方法 2 from zhihu_oauth import ZhihuClient 3 4 client = ZhihuClient 5 client.load_token('token.pkl') # 加載token文件 6 # 顯示自己的相關(guān)信息 7 me = client.me 8 9 # 獲取最近 5 個回答 10 for _, answer in zip(range(5), me.answers): 11 print(answer.question.title, answer.voteup_count) 12 13 print('----------') 14 15 # 獲取點贊量最高的 5 個回答 16 for _, answer in zip(range(5), me.answers.order_by('votenum')): 17 print(answer.question.title, answer.voteup_count) 18 19 print('----------') 20 21 # 獲取最近提的 5 個問題 22 for _, question in zip(range(5), me.questions): 23 print(question.title, question.answer_count) 24 25 print('----------') 26 27 # 獲取最近發(fā)表的 5 個文章 28 for _, article in zip(range(5), me.articles): 29 print(article.title, article.voteup_count)
當然可以干的事情還遠遠不止這些,比如我們知道了某個問題的url地址或者問題id,就可以獲得這個問題下有多少個回答,作者的信息等等一系列詳細的信息。開發(fā)者想的真的挺周到的,一般常見的需要的信息基本全部都包括了。具體的代碼我就不貼了,大家自行參考官方文檔。
一個小的tips:由于這個庫有好多個類,比如獲得作者信息的類,獲得文章信息的類等等。每個類都有非常多的方法,我去看了一下官方文檔,作者有些類的屬性就沒有完全列出來,那么我們怎么查看這個類全部的屬性呢?其實很簡單,只需要使用python的dir函數(shù)就可以了,使用dir(object)可以查看object類(或?qū)ο螅┑娜繉傩浴1热缥覀冇幸粋€answer類對象,使用dir(answer)就會返回answer對象所有屬性的列表。除去默認的一些屬性之外,我們就可以找到這個類的我們需要的屬性了,很方便吧。(下面是collection即收藏夾類的全部屬性)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_build_data', '_build_params', '_build_url', '_cache', '_data', '_get_data', '_id', '_method', '_refresh_times', '_session', 'answer_count', 'answers', 'articles', 'comment_count', 'comments', 'contents', 'created_time', 'creator', 'description', 'follower_count', 'followers', 'id', 'is_public', 'pure_data', 'refresh', 'title', 'updated_time']
最后,我使用這個類,抓取了知乎某個問題下所有回答中的圖片(抓美女圖,哈哈哈哈),只用了不到30行代碼(去掉注釋)。分享給大家。1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 # @Time : 2017/5/3 14:27 4 # @Author : Lyrichu 5 # @Email : 919987476@qq 6 # @File : save_images.py 7 ''' 8 @Description:保存知乎某個問題下所有答案的圖片 9 ''' 10 from __future__ import print_function # 使用python3的print方法 11 from zhihu_oauth import ZhihuClient 12 import re 13 import os 14 import urllib 15 16 client = ZhihuClient 17 # 登錄 18 client.load_token('token.pkl') # 加載token文件 19 id = 24400664 # https://zhihu/question/24400664(長得好看是一種怎么樣的體驗) 20 question = client.question(id) 21 print(u"問題:",question.title) 22 print(u"回答數(shù)量:",question.answer_count) 23 # 建立存放圖片的文件夾 24 os.mkdir(question.title + u"(圖片)") 25 path = question.title + u"(圖片)" 26 index = 1 # 圖片序號 27 for answer in question.answers: 28 content = answer.content # 回答內(nèi)容 29 re_compile = repile(r'') 30 img_lists = re.findall(re_compile,content) 31 if(img_lists): 32 for img in img_lists: 33 img_url = img[0] # 圖片url 34 urllib.urlretrieve(img_url,path+u"/%d.jpg" % index) 35 print(u"成功保存第%d張圖片" % index) 36 index += 1
如果要是自己寫的話,直接抓取解析網(wǎng)頁是無法獲得全部回答的,所以只能去破解知乎的api,比較麻煩,使用這個現(xiàn)成的輪子就方便很多了。以后想慢慢欣賞知乎的美女就再也不用發(fā)愁啦,嘿嘿嘿。
Python模擬登錄知乎!你可能見過很多教程!這篇是史上最詳細的! 互聯(lián)網(wǎng)視頻課程
前言
前天看到一個爬取了知乎50多萬評論的帖子, 羨慕的同時也想自己來嘗試一下??纯茨懿荒塬@取一些有價值的信息。
這就是referer起到的作用,服務器在接收到一個請求的時候先判斷Referer是否為本站的地址。如果是的話就返回正確的資源;如果不是,就返回給客戶端預先準備好的“警示”資源。
如果網(wǎng)站僅僅做到了這一步,而你的程序又恰好添加了User-Agent,基本上就可以順利的蒙混過關(guān)了。
隱藏域
很多時候,我們模擬登錄的時候需要提交的數(shù)據(jù)并不僅僅是用戶名密碼,還有一些隱藏域的數(shù)據(jù)。比如拿咱們CSDN來說,查看登錄頁
模擬登錄
在正式的模擬登錄知乎之前,我先來寫個簡單的小例子來加深一下印象。
瀏覽器測試
正常提交用戶名密碼的話如下:
我們不難發(fā)現(xiàn),服務器端和客戶端使用了相同的計算規(guī)則,這樣的話我們就可以實現(xiàn)對客戶端的登錄請求進行一次簡答的甄選了。正常的瀏覽器請求都是沒有問題的。
用戶名或者密碼填寫錯誤的情況如下:
運行的結(jié)果如下:
因為我們”不知道”服務器端是怎么對token處理的具體的邏輯。所以還是需要從客戶端的網(wǎng)頁下手。
且看下面的圖片。
注意:這里僅僅是為了演示的方便,采用了對username字段失去焦點時計算token。實際上在網(wǎng)頁被拉取到客戶端瀏覽器的時候, 服務器會事先計算好token的值,并賦予到token字段的。所以大可不必計較這里的實現(xiàn)。
Python代碼
實現(xiàn)效果如下:
實現(xiàn)的效果如下
更新版知乎模擬登陸
代碼部分
驗證效果
謝謝閱讀,希望你能學會哦!
python3網(wǎng)絡(luò)爬蟲 (6)-分析知乎問題頁面數(shù)據(jù) 公司視頻課程
注:本文只做數(shù)據(jù)來源分析,暫未抓取數(shù)據(jù)
1. 打開知乎頁面(地址來自上次爬蟲爬取的數(shù)據(jù))
示例: https://zhihu/question/41508191
2. 打開可以看到需要抓取的數(shù)據(jù)有(標簽、標題、描述、答案)
頁面
3. 查看網(wǎng)頁請求狀況(由于該問題答案較少,暫時用 https://zhihu/question/65381487 查看接口數(shù)據(jù))
可以發(fā)現(xiàn)答案的接口。(還有相似問題和相關(guān)live,暫時沒有用到)
查看接口
4. 由于我們請求到的網(wǎng)頁中的js是不會執(zhí)行的,所以我們先禁用瀏覽器js(js禁用方法,請自行百度)
禁用js后的頁面
5. 接口只能看到答案,所以我們還需要在頁面上找到其他數(shù)據(jù)
經(jīng)過對比發(fā)現(xiàn),js執(zhí)行過的描述是有圖片的,但是js未執(zhí)行的沒有圖片,描述不夠完整。
但是沒有描述的請求,所以,猜測描述被隱藏在了頁面的其他地方
搜索中的描述部分內(nèi)容,可以發(fā)現(xiàn)確實被隱藏在了標簽中
6. 將描述內(nèi)容格式化
格式化后發(fā)現(xiàn),需要獲取的標簽、標題、描述等信息均在里面,不用再去網(wǎng)站上查找其他接口
格式化數(shù)據(jù)
喜歡就點個贊吧!
基于python的知乎開源爬蟲 zhihu 公司視頻課程
今天在無意之中發(fā)現(xiàn)了一個知乎的開源爬蟲,是基于Python的,名字叫zhihu_oauth,看了一下在github上面star數(shù)還挺多的,貌似文檔也挺詳細的,于是就稍微研究了一下。發(fā)現(xiàn)果然很好用啊。就在這里給大家介紹一下如何使用。
項目的主頁地址在:https://github/7sDream/zhihu-oauth。作者的知乎主頁為:https://zhihu/people/7sdream/。
項目的文檔地址為:http://zhihu-oauth.readthedocs.io/zh_CN/latest/index.html 。講道理,原作者對于該怎么使用這個庫已經(jīng)講的非常詳細了,我在這里再重復一遍簡直就是畫蛇添足。所以大家要是想詳細了解這個庫怎么用,就去官方文檔吧。我只說一下我覺得需要補充的重要的幾點。
首先是安裝。作者已經(jīng)將項目上傳到pypi了,所以我們可以直接使用pip進行安裝了。按照作者的說法,項目對于Python3的支持更好,淡然目前也是兼容Python2的,所以大家最好使用python3.直接 pip3 install -U zhihu_oauth 即可安裝。
安裝好了第一步就是登陸。直接使用下面的代碼就可以登陸。1 from zhihu_oauth import ZhihuClient 2 from zhihu_oauth.exception import NeedCaptchaException 3 client = ZhihuClient 4 user = 'email_or_phone' 5 pwd = 'password' 6 try: 7 client.login(user, pwd) 8 print(u"登陸成功!") 9 except NeedCaptchaException: # 處理要驗證碼的情況 10 # 保存驗證碼并提示輸入,重新登錄 11 with open('a.gif', 'wb') as f: 12 f.write(client.get_captcha) 13 captcha = input('please input captcha:') 14 client.login('email_or_phone', 'password', captcha) 15 16 client.save_token('token.pkl') # 保存token 17 #有了token之后,下次登錄就可以直接加載token文件了 18 # client.load_token('filename')
上面的代碼是直接使用賬號密碼登陸,最后保存了登陸之后的token,在下次登錄的時候我們就可以直接使用token登錄而不用每次都輸入密碼了。
在登錄完成之后,可以干的事情當然就很多了,比如下面的代碼就可以獲得自己的知乎賬戶的基本信息1 from __future__ import print_function # 使用python3的print方法 2 from zhihu_oauth import ZhihuClient 3 4 client = ZhihuClient 5 client.load_token('token.pkl') # 加載token文件 6 # 顯示自己的相關(guān)信息 7 me = client.me 8 9 # 獲取最近 5 個回答 10 for _, answer in zip(range(5), me.answers): 11 print(answer.question.title, answer.voteup_count) 12 13 print('----------') 14 15 # 獲取點贊量最高的 5 個回答 16 for _, answer in zip(range(5), me.answers.order_by('votenum')): 17 print(answer.question.title, answer.voteup_count) 18 19 print('----------') 20 21 # 獲取最近提的 5 個問題 22 for _, question in zip(range(5), me.questions): 23 print(question.title, question.answer_count) 24 25 print('----------') 26 27 # 獲取最近發(fā)表的 5 個文章 28 for _, article in zip(range(5), me.articles): 29 print(article.title, article.voteup_count)
當然可以干的事情還遠遠不止這些,比如我們知道了某個問題的url地址或者問題id,就可以獲得這個問題下有多少個回答,作者的信息等等一系列詳細的信息。開發(fā)者想的真的挺周到的,一般常見的需要的信息基本全部都包括了。具體的代碼我就不貼了,大家自行參考官方文檔。
一個小的tips:由于這個庫有好多個類,比如獲得作者信息的類,獲得文章信息的類等等。每個類都有非常多的方法,我去看了一下官方文檔,作者有些類的屬性就沒有完全列出來,那么我們怎么查看這個類全部的屬性呢?其實很簡單,只需要使用python的dir函數(shù)就可以了,使用dir(object)可以查看object類(或?qū)ο螅┑娜繉傩?。比如我們有一個answer類對象,使用dir(answer)就會返回answer對象所有屬性的列表。除去默認的一些屬性之外,我們就可以找到這個類的我們需要的屬性了,很方便吧。(下面是collection即收藏夾類的全部屬性)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_build_data', '_build_params', '_build_url', '_cache', '_data', '_get_data', '_id', '_method', '_refresh_times', '_session', 'answer_count', 'answers', 'articles', 'comment_count', 'comments', 'contents', 'created_time', 'creator', 'description', 'follower_count', 'followers', 'id', 'is_public', 'pure_data', 'refresh', 'title', 'updated_time']
最后,我使用這個類,抓取了知乎某個問題下所有回答中的圖片(抓美女圖,哈哈哈哈),只用了不到30行代碼(去掉注釋)。分享給大家。1 #!/usr/bin/env python 2 # -*- coding: utf-8 -*- 3 # @Time : 2017/5/3 14:27 4 # @Author : Lyrichu 5 # @Email : 919987476@qq 6 # @File : save_images.py 7 ''' 8 @Description:保存知乎某個問題下所有答案的圖片 9 ''' 10 from __future__ import print_function # 使用python3的print方法 11 from zhihu_oauth import ZhihuClient 12 import re 13 import os 14 import urllib 15 16 client = ZhihuClient 17 # 登錄 18 client.load_token('token.pkl') # 加載token文件 19 id = 24400664 # https://zhihu/question/24400664(長得好看是一種怎么樣的體驗) 20 question = client.question(id) 21 print(u"問題:",question.title) 22 print(u"回答數(shù)量:",question.answer_count) 23 # 建立存放圖片的文件夾 24 os.mkdir(question.title + u"(圖片)") 25 path = question.title + u"(圖片)" 26 index = 1 # 圖片序號 27 for answer in question.answers: 28 content = answer.content # 回答內(nèi)容 29 re_compile = repile(r'') 30 img_lists = re.findall(re_compile,content) 31 if(img_lists): 32 for img in img_lists: 33 img_url = img[0] # 圖片url 34 urllib.urlretrieve(img_url,path+u"/%d.jpg" % index) 35 print(u"成功保存第%d張圖片" % index) 36 index += 1
如果要是自己寫的話,直接抓取解析網(wǎng)頁是無法獲得全部回答的,所以只能去破解知乎的api,比較麻煩,使用這個現(xiàn)成的輪子就方便很多了。以后想慢慢欣賞知乎的美女就再也不用發(fā)愁啦,嘿嘿嘿。