crawl4ai icon indicating copy to clipboard operation
crawl4ai copied to clipboard

Using Proxy

Open shing-li opened this issue 1 year ago • 5 comments
trafficstars

There's a example code for proxy, but I didn't see the proxy parameter in class AsyncWebCrawler()

shing-li avatar Oct 01 '24 08:10 shing-li

Hi, This is code sample to try proxy:

async def use_proxy():
    print("\n--- Using a Proxy ---")
    print(
        "Note: Replace 'http://your-proxy-url:port' with a working proxy to run this example."
    )
    # Uncomment and modify the following lines to use a proxy
    async with AsyncWebCrawler(verbose=True, proxy="http://your-proxy-url:port") as crawler:
        result = await crawler.arun(
            url="https://www.nbcnews.com/business",
            bypass_cache=True
        )
        print(result.markdown[:500]) 

Feel free to let me know if you need any thing :)

unclecode avatar Oct 02 '24 08:10 unclecode

Hi @unclecode, I am getting this error after running the above code:

AsyncWebCrawler.init() got an unexpected keyword argument 'proxy'

PratikHotchandani22 avatar Oct 02 '24 15:10 PratikHotchandani22

Hi @unclecode, I am getting this error after running the above code:

AsyncWebCrawler.init() got an unexpected keyword argument 'proxy'

I got the same issue :(

anthonytison avatar Oct 02 '24 19:10 anthonytison

I can see an active PR regarding this issue:

https://github.com/unclecode/crawl4ai/pull/119

PratikHotchandani22 avatar Oct 03 '24 16:10 PratikHotchandani22

TypeError: AsyncWebCrawler.init() got an unexpected keyword argument 'proxy' me too

SwallowData avatar Oct 10 '24 03:10 SwallowData

Here's the documentation on using proxy

aravindkarnam avatar Jan 21 '25 04:01 aravindkarnam