nodejs-tw / ama

Ask me anything!
MIT License
31 stars 1 forks source link

node.js製作一個爬蟲 #31

Open BenhuangBot opened 6 years ago

BenhuangBot commented 6 years ago

目的

我想要用node.js製作一個爬蟲來抓取特定網站上的資料,這些資料需要登錄網站後才看得到,我有該網站的帳號密碼,請問我應該怎樣下手比較好?

poying commented 6 years ago

剛好有個範例 https://github.com/taiwan/tocwc-data

如果需要讓網站執行 js 那讓程式開瀏覽器抓取資料比較簡單,如同上面那個範例。其他情況只需要確保每個 http request 都有帶 cookie,response 回來的 cookie 也都有存下來供發 request 使用即可。至於怎的處理 cookie 就要看你用那套 library。

CI build error 是因為懶的修,功能是對的

BenhuangBot commented 6 years ago

太感謝大大了︿﹍﹍︿ 拍謝因為Gmail把這封信丟到垃圾桶==現在才看到非常抱歉

Po-Ying Chen notifications@github.com 於 2018年1月8日 下午7:08 寫道:

剛好有個範例 https://github.com/taiwan/tocwc-data

如果需要讓網站執行 js 那讓程式開瀏覽器抓取資料比較簡單,如同上面那個範例。其他情況只需要確保每個 http request 都有帶 cookie,response 回來的 cookie 也都有存下來供發 request 使用即可。至於怎的帶 cookie 就要看你用那套 library。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nodejs-tw/ama/issues/31#issuecomment-355938502, or mute the thread https://github.com/notifications/unsubscribe-auth/AfhLSYfFbakslarKu9mj6xFWvrHCgXTDks5tIfdKgaJpZM4RVn_Z .

-- 黃韋霖(BEN),專長是圖型演算法,善於解決程式等等問題。 手機:0970820256 電子郵件:king810406@gmail.com