Throwing error on `serpapi.search`
まだ誰も着手していません。
評価
調査の方向性
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
- スター
- 173
- フォーク
- 24
- 平均マージ
- 1日 17時間
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
serpapi/serpapi-python のほかの issue
-
improvement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
serpapi/serpapi-python#27 · コメント 5 件 ·