mido_hany
01/26/2025, 9:19 PMpy
import asyncio, httpx
from apify import Actor
import dotenv
async def main():
async with Actor:
proxy_configuration = await Actor.create_proxy_configuration(
password=dotenv.get_key('.env', 'APIFY_PROXY_PASSWORD'),
)
proxy_url = await proxy_configuration.new_url()
proxies = {
'http': proxy_url,
'https': proxy_url,
}
async with httpx.AsyncClient(proxy=proxy_url) as client:
for _ in range(3):
response = await client.get('https://httpbin.org/ip')
if response.status_code == 200:
print(response.json())
elif response:
print(response.text)
if __name__ == '__main__':
asyncio.run(main())
giveing me a proxy error:
raise mapped_exc(message) from exc
httpx.ReadTimeout
[apify] INFO Exiting Actor ({"exit_code": 91})
If i just only change the protocol to http://httpbin.org/ip it works.
Apify proxy should support https as stated on the site. Thanks in advance.Rado Ch.
01/28/2025, 12:31 PMmido_hany
01/28/2025, 2:01 PMRado Ch.
01/28/2025, 2:07 PM