Skip to content

[NODRIVER] Cant set cookies? #2232

@zerxdapro

Description

@zerxdapro

I've tried the browser and the page. For some reason it just isnt setting cookies to the storage. This is the code I have and I've tried many other variations. If someone could help me that would be awesome!

        import nodriver as uc
        from nodriver.cdp import storage
        from nodriver.cdp.network import CookieParam

        browser = await uc.start(browser_args=browser_args)
        main_tab = await browser.get("draft:,")
        await setup_proxy(proxyusername, proxypassword, main_tab)
        
        page = await browser.get('https://www.web.com')
        
        cookies = CookieParam(
            name="__Host-instacart_sid",
            value=token,
            domain="www.instacart.com",
            path="/",
            secure=True,
            http_only=True
        )
        await page.send(storage.set_cookies(cookies))
        
        await page.reload()

When I try with page, I get this: 'Tab' has no attribute 'get_cookies'
When I try with browser, no error, but it doesnt actually put the cookies in. What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions