我正在嘗試使用 python 來谷歌搜索以使用特定的 RegEx 獲取結果。這可能嗎?
uj5u.com熱心網友回復:
您可以使用 Google 的 Python 包googlesearch-python:
pip install googlesearch-python
然后就像指定要搜索的內容、要回傳的專案數量以及要搜索的語言一樣簡單。示例:
googlesearch.search(str: "stackoverflow", int: num_results=10, str: lang="en") -> list
參考:https ://github.com/Nv7-GitHub/googlesearch
uj5u.com熱心網友回復:
從理論上講,您可以使用像 Google 這樣的爬蟲庫,BeautifoulSoup但鑒于 Google 正在保護其服務,您可能會在結果中遇到驗證碼。您可以使用Google Search Console合法地執行此操作
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/476788.html
