1.因為東財?shù)臄?shù)據(jù)是通過異步提取,所有可以以
用瀏覽器的開發(fā)工具 network-js-刷新 的方式得到數(shù)據(jù)接口
分析后以 3426項為結(jié)束 并用1頁請求下來籍救, 避免東財?shù)谋O(jiān)控
http://datainterface.eastmoney.com/EM_DataCenter/JS.aspx?type=FD&sty=TSTC&st=1&sr=1&p=1&ps=3426
2.使用scrapy 以 scrapy.Request 分兩步爬取
1步爬取本頁的基本數(shù)據(jù)
2步分析另一頁的鏈接 并爬取數(shù)據(jù)(以http://data.eastmoney.com/stockcomment/%s.html %s為股票代碼 得到詳情頁)
3 將兩頁的數(shù)據(jù)合并在一起 存入數(shù)據(jù)庫
4 定時更新時分為按股票代碼 如果存在就存儲 如果已經(jīng)有了习绢,就更新的原則