Comments (1)
Hi 您好,很高興您提出問題。
如同我在首頁的說明,我認為這是滾動式的網頁,算是蠻主流的方式,也算是防爬蟲的一種技術,雖非完全無法解,但可能無法讓爬蟲者過得太舒適。
何謂滾動式網頁? 可以把他理解成當你的瀏覽器提出請求時,他預設給你N篇新聞,剩下的新聞他會靠捕捉你的瀏覽器行為來給你額外的新聞。瀏覽器行為在我們的例子中就是滾動網頁。
您可以仔細的觀察,當您將滑鼠滾輪慢慢地往下滾,是不是有感覺到網頁卡了一下,他好像在load什麼內容? 這就是他捕捉你的操作行為,可能是滾到最後一篇新聞了,再額外給你另外N篇,當你再次滾玩,再給你N篇,直到他設置的上限,我記得上限是一個月的新聞。
不知道這樣您是否能夠理解,我們單純requests為什麼只有20篇,因為requests只是請求,不包含滑鼠滾動這個動作,自然不會觸發對方的系統給你多一點新聞。
或許還有其他解,但比較直接的解就是Selenium(類似用程式操作瀏覽器,模仿人的行為),模擬滾動到底的動作,再做requests解析,但如同首頁所述,這是比較進階的技術了,而且在爬蟲領域中,應該是真的無可解,萬不得以才會使用Selenium,因為他的速度及耗費的資源都比單純的requests差非常多。
Selenium技術您可以了解一下,若是有興趣鑽研爬蟲,這也算是必備的技術之一了。
from python-and-taiwan-stock-market.
Related Issues (20)
- 遇到 OSError? HOT 8
- 排程的權限問題及執行檔問題 HOT 7
- Google 不支援低安全模式 HOT 1
- 爬蟲遇到的問題 HOT 3
- stock_list.py執行錯誤 HOT 8
- 請問關於自動寄信 HOT 3
- about pandas rolling HOT 2
- 關於yahoo_new小程式 HOT 2
- 關於matplotlib HOT 7
- backtrader問題 HOT 2
- 關於 mpl_finance失效的問題 HOT 2
- 有關更多操作自動化的問題 HOT 2
- 關於PYTHON 金融市場賺大錢聖經書中 HOT 7
- 關於AES_Encryption等第三章問題 HOT 50
- 第1-4虛擬環境 HOT 7
- 第二章27頁 HOT 11
- python聖經第三章3.2小節的代碼問題 HOT 1
- pyfolio 問題 HOT 1
- 第三章'Crypto'的問題 HOT 1
- 第二章 2-21 輸出的中文變成亂碼 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-and-taiwan-stock-market.