Throwing error on `serpapi.search`
還沒有人認領這個 Issue。
評估
研究方向
Start by locating the Python implementation of serpapi.search and determine how HTTP errors, especially 429 responses, are currently handled. Use the reported try-catch example as the expected usage pattern, then update the README with error-handling guidance; done means search failures raise a proper error and the documented example explains rate limiting.
由索引模型根據 Issue 內容生成。
描述
The developer team from a high-volume customer reached out that we should throw a proper error on the serpapi.search.
I've suggested using a try-catch exception to handle errors. For example:
try:
search = serpapi.search(q="CoffeeMilk", api_key="", engine="google", location="Austin, Texas", hl="en", gl="us")
print(search)
print("----------------")
except Exception as e:
if "429" in str(e):
print("You are being rate limited")
print(e)
else:
print("An error occurred")
sidenote: we should probably update our readme to show how to handle errors.
- 主要語言
- Python
- 星號
- 183
- 分支
- 28
- 平均合併
- 8 天 14 小時
- 30 天內合併 PR
- 1
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
serpapi/serpapi-python 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 48/100
serpapi/serpapi-python#54 ·
-
難度 4/5 3-5 天 新手友好度 55/100
serpapi/serpapi-python#53 ·
查看 serpapi/serpapi-python 的全部 Issue
相似的 Issue
-
todo
難度 1/5 1 小時以內 新手友好度 72/100
tonybaloney/CSnakes#864 ·
-
infra
難度 1/5 1 小時以內 新手友好度 90/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 65/100
libre-embedded/svgen#72 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
Genesis-Embodied-AI/genesis-world#3950 ·
維護者通常 1 天內回覆
-
accessibility
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆