Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post/2019/12/ptt-crawler-and-listener/ #10

Open
utterances-bot opened this issue Aug 31, 2021 · 6 comments
Open

post/2019/12/ptt-crawler-and-listener/ #10

utterances-bot opened this issue Aug 31, 2021 · 6 comments

Comments

@utterances-bot
Copy link

Python: 用爬蟲在 PTT 上監聽關鍵字並寄通知信 | 伊果的沒人看筆記本

Python 爬蟲練習:當 PTT 團購板上新發了一篇 Netflix 的文,馬上寄信告訴我。主要步驟為用 Python 的 requests_html 包爬 PTT 團購板的文章標題、並寄信(使用 Gmail)和持續監視。

https://igouist.github.io/post/2019/12/ptt-crawler-and-listener/

Copy link

很讚诶超實用 另外想問如果想用linebot做連結,流程大概會是怎樣呢?

@Igouist
Copy link
Owner

Igouist commented Sep 14, 2021

很讚诶超實用 另外想問如果想用linebot做連結,流程大概會是怎樣呢?

Hi @a2152265,
像這類監聽回報、不需要互動的狀況,我會傾向使用 Line Notify 來處理
我在另一篇的爬蟲有實作過一次,提供給你參考:我要訂便當 (3): 用 Python + Line Notify 傳送通知

如果因為某些元素必須使用 Line bot 來處理的話,我有看到這篇 Python+LINE Bot教學 - 6步驟快速上手LINE Bot機器人 (learncodewithmike.com) 感覺挺不錯,也給你參考看看。

祝你順利~

Copy link

想請問大大:要怎麼讓它判斷說已經寄過信了不會再對同一篇文章寄信

@Igouist
Copy link
Owner

Igouist commented Dec 28, 2021

Hi @suth181387,
重點會是在第二次以後執行時,要怎麼告訴爬蟲「看過了」。
所以我應該會找個地方(資料庫或是 CSV 之類的)把標題和作者存起來,寄信之前再比對看看。
在同樣用爬蟲的我要訂便當文章中,我有試過用 Sqlite 來達到差不多的目標,給你參考。祝順利~

Copy link

您好
請問現在gmail已經不再支援低安全性應用程式存取權
現在該怎麼讓這個程式自動寄信呢?

Copy link

沒事了
我已經解決自動寄信的問題了 : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants