MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / _search_proxy

Function _search_proxy

scrapegraphai/utils/proxy_rotation.py:163–179  ·  view source on GitHub ↗

searches for a proxy server matching the specified broker criteria Args: proxy: The proxy configuration to search for. Returns: A 'playwright' compliant proxy configuration.

(proxy: Proxy)

Source from the content-addressed store, hash-verified

161
162
163def _search_proxy(proxy: Proxy) -> ProxySettings:
164 """searches for a proxy server matching the specified broker criteria
165
166 Args:
167 proxy: The proxy configuration to search for.
168
169 Returns:
170 A 'playwright' compliant proxy configuration.
171 """
172
173 # remove max_shape from criteria
174 criteria = proxy.get("criteria", {}).copy()
175 criteria.pop("max_shape", None)
176
177 server = search_proxy_servers(max_shape=1, **criteria)[0]
178
179 return {"server": server}
180
181
182def is_ipv4_address(address: str) -> bool:

Callers 2

parse_or_search_proxyFunction · 0.85

Calls 2

search_proxy_serversFunction · 0.85
getMethod · 0.80

Tested by 1