• Python 爬蟲 抓取 Google 搜尋結果的連結
  • 推文至Facebook  
  • 記錄一下批量抓取 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

    NetYea,網頁設計,網站架設,SEO, 網頁優化

     

    接下來設定排程

    /usr/bin/python3 /home/xxx/public_html/seo_crawler.py > /dev/null 2>&2

    演示圖:

    NetYea,網頁設計,網站架設,SEO, 網頁優化

    NetYea,網頁設計,網站架設,SEO, 網頁優化

  • 標籤:Python, 爬蟲, Google,
NetYea 客服 NetYea 客服
NetYea 客服

Python 爬蟲 抓取 Google 搜尋結果的連結 -