opda0887 / Bahamut-Crawler-To-Gmail

發想:使用Python爬蟲取得巴哈姆特版面的最新論壇,並用gmail傳送這些訊息給自己。A thought: Use Python crawler to the latest forums in Bahamut, and use gmail to send these messages to myself.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tutorial(使用教學)📝

🌳環境設定(Env Setting)

如果可以,使用 VS Code,以方便跟著我接下來的步驟
在 cmd 中打上:
pip install Scrapy
pip install BeautifulSoup4
pip install twisted

👀成果預覽畫面(Preview)

img

👌使用說明(Features):

  1. 找到:Bahamut-Crawler-To-Gmail-main -> Baha -> spiders -> clawer 並打開找到"categorys"
    img 在這裡可以挑選日後要在巴哈上取得的資料

  2. clawer檔案中中找到"titles",並依自己需求替換成"categorys"中你喜歡的板的名稱**(全名)**
    img 我拿:場外休息區 作範例("categorys"中的第一個)

  3. 找到 # send email 那行,我們要設定誰要接收到巴哈的資料
    img email_sender = '<sender>' 中的 <sender> 替換成發送mail的帳號( ‼一定要是gmail,否則後續會出錯)
    email_password = '<password>' :第4步會詳細解釋該替換成甚麼
    email_receiver = '<receiver>' 中的 <receiver> 替換成接收mail的帳號(任何mail帳號都可、也可和 email_sender 一樣)

  4. 設定password
    先到 https://myaccount.google.com/ 中,點選左方欄位的安全性
    img 往下滑並找到 登入 Google 欄位中的 兩步驟驗證,並完成設定
    接著,到 https://myaccount.google.com/apppasswords 中,找到名為選取應用程式並點選其中的其他(自訂名稱)
    img 名稱隨意取,之後按下產生就來到以下畫面
    img 右上角黃色格子內的是你的email_password,將他複製並將 email_password = '<password>' 中的 <password> 改成你複製的代碼即可

  5. 在 Bahamut-Crawler-To-Gmail-main -> Baha -> rutineRun 中打開rutineRun,你會看到程式碼中有一變數timeSet
    img 你可以改成你要的數字,取決於你想間格多少秒接收到一次新的data

  6. rutineRun中,於terminal中執行以下指令:
    python routineRun.py
    img 之後去看你設定接收mail的那隻帳號,就會發現到你所設定版面的全新資訊瞜❤️

If you have any feedbacks, just contact me (≧∀≦)

About

發想:使用Python爬蟲取得巴哈姆特版面的最新論壇,並用gmail傳送這些訊息給自己。A thought: Use Python crawler to the latest forums in Bahamut, and use gmail to send these messages to myself.


Languages

Language:Python 100.0%