論文復現Part1.透過Python Selenium自動爬取Smashwords指定的免費風格小說(Romance:500篇/Horror:621篇)
Deep Learning-Based Short Story Generation for an Image Using the Encoder-Decoder Structure
這邊要注意Smashword要先註冊一個平台後
每一天有限制最多只能下載500本電子檔案,因此若超額就會下載失敗。
預設存檔指定到Google Drive特定目錄,下次可以依照進度續Run。
使用到的套件有selenium
pip install google-colab-selenium -q
透過網頁瀏覽操作可以觀察到網址等規則進行爬蟲
Romance
Horror
針對Romance分頁網址行為變化可以觀察到從0開始為第一頁後續依此類推。
https://www.smashwords.com/shelves/shelf/morefree/1235/free/medium/0
https://www.smashwords.com/shelves/shelf/morefree/1235/free/medium/1
https://www.smashwords.com/shelves/shelf/morefree/1235/free/medium/2
程式碼
愛情(romance):500 篇
恐怖(horror):621 篇
留言
張貼留言