Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Proxy #116

Open
shing-li opened this issue Oct 1, 2024 · 4 comments
Open

Using Proxy #116

shing-li opened this issue Oct 1, 2024 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@shing-li
Copy link

shing-li commented Oct 1, 2024

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

@unclecode
Copy link
Owner

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 :)

@PratikHotchandani22
Copy link

PratikHotchandani22 commented Oct 2, 2024

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

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

@anthonytison
Copy link

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 :(

@PratikHotchandani22
Copy link

I can see an active PR regarding this issue:

#119

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants