Apify and Crawlee Official Forum

Updated 3 weeks ago

Proxy configuration am I doing it wrong?

Plain Text
async def main() -> None:
    """The crawler entry point."""
    proxy_configuration = ProxyConfiguration(

        proxy_urls=[
            'https://xxx:xx/',
            'https://xxx:xx/',
        ]
    )
    crawler = PlaywrightCrawler(
        headless=False,
        request_handler=router,
        max_requests_per_crawl=50,
        proxy_configuration=proxy_configuration,

    )

I am using playwrightcrawler and when I use this code its showing error ->
Plain Text
 playwright._impl._api_types.Error: Browser needs to be launched with the global proxy. If all contexts override the proxy, global proxy will be never used and can be any string, for example "launch({ proxy: { server: 'http://per-context' } })"
A
M
S
4 comments
@Shine just advanced to level 1! Thanks for your contributions! πŸŽ‰
what version of crawlee are you using? In 0.4.2 I have no problem with this.

Alternative. You can try passing the proxy parameter { server: 'http://per-context' } to playwright.launch as per this example - https://github.com/apify/crawlee-python/discussions/715
I am using 0.4.3 version
it worked after i created a fresh project
Add a reply
Sign up and join the conversation on Discord