MCPcopy Create free account
hub / github.com/apify/crawlee-python / main

Function main

docs/deployment/code_examples/apify/proxy_example.py:6–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4
5
6async def main() -> None:
7 async with Actor:
8 # Create a new Apify Proxy configuration. The password can be found at
9 # https://console.apify.com/proxy/http-settings and should be provided either
10 # as a parameter "password" or as an environment variable "APIFY_PROXY_PASSWORD".
11 proxy_configuration = await Actor.create_proxy_configuration(
12 password='apify_proxy_YOUR_PASSWORD',
13 )
14
15 if not proxy_configuration:
16 Actor.log.warning('Failed to create proxy configuration.')
17 return
18
19 proxy_url = await proxy_configuration.new_url()
20 Actor.log.info(f'Proxy URL: {proxy_url}')
21
22
23if __name__ == '__main__':

Callers 1

proxy_example.pyFile · 0.70

Calls 1

new_urlMethod · 0.80

Tested by

no test coverage detected