Initialize the BingSearch instance with the given subscription key. Parameters ---------- subscription_key : str The subscription key to use for the Bing API.
(self, subscription_key : str)
| 30 | Load the detailed page of the search result at the given index. |
| 31 | """ |
| 32 | def __init__(self, subscription_key : str) -> None: |
| 33 | """ |
| 34 | Initialize the BingSearch instance with the given subscription key. |
| 35 | |
| 36 | Parameters |
| 37 | ---------- |
| 38 | subscription_key : str |
| 39 | The subscription key to use for the Bing API. |
| 40 | """ |
| 41 | self._headers = { |
| 42 | 'Ocp-Apim-Subscription-Key': subscription_key |
| 43 | } |
| 44 | self._endpoint = "https://api.bing.microsoft.com/v7.0/search" |
| 45 | self._mkt = 'en-US' |
| 46 | |
| 47 | def search(self, key_words : str, max_retry : int = 3): |
| 48 | for _ in range(max_retry): |
nothing calls this directly
no outgoing calls
no test coverage detected