【Python 爬蟲】抓取 Google 搜尋成績的連結
2023/06/09 00:01
紀錄一下批量抓取 Google 搜尋成效裡的連結的方式。
若是還沒有安裝以下,要先下載安裝:
- pip install beautifulsoup4
- pip install google
複製代碼
Code
- from googlesearch import search
- query = "cambridge"
- for j in search(query, stop=5, pause=2.0):
- print(j)
-
複製代碼
Result


接下來設定排程
- /usr/bin/python3 /home/xxx/public_html/seo_crawler.py > /dev/null 2>&2

文章出處
本篇文章引用自此: 網頁設計