| 4 | |
| 5 | |
| 6 | async 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 | |
| 23 | if __name__ == '__main__': |