MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / request_batch

Method request_batch

bbot/core/helpers/web/web.py:132–152  ·  view source on GitHub ↗

Given a list of URLs, request them in parallel and yield responses as they come in. Args: urls (list[str]): List of URLs to visit *args: Positional arguments to pass through to httpx **kwargs: Keyword arguments to pass through to httpx E

(self, urls, *args, **kwargs)

Source from the content-addressed store, hash-verified

130 return result
131
132 async def request_batch(self, urls, *args, **kwargs):
133 """
134 Given a list of URLs, request them in parallel and yield responses as they come in.
135
136 Args:
137 urls (list[str]): List of URLs to visit
138 *args: Positional arguments to pass through to httpx
139 **kwargs: Keyword arguments to pass through to httpx
140
141 Examples:
142 >>> async for url, response in self.helpers.request_batch(urls, headers={"X-Test": "Test"}):
143 >>> if response is not None and response.status_code == 200:
144 >>> self.hugesuccess(response)
145 """
146 agen = self.run_and_yield("request_batch", urls, *args, **kwargs)
147 while 1:
148 try:
149 yield await agen.__anext__()
150 except (StopAsyncIteration, GeneratorExit):
151 await agen.aclose()
152 break
153
154 async def request_custom_batch(self, urls_and_kwargs):
155 """

Callers 6

queryMethod · 0.45
handle_eventMethod · 0.45
handle_eventMethod · 0.45
handle_eventMethod · 0.45
test_web_engineFunction · 0.45

Calls 1

run_and_yieldMethod · 0.45

Tested by 2

test_web_engineFunction · 0.36