Skip to content

Allow camera permissions with undetected driver #1566

Answered by mdmintz
KolyStudio asked this question in Q&A
Discussion options

You must be logged in to vote

You can access the SeleniumBase driver with sb.driver or self.driver (depending on whether you're using sb or self as the access point.

With your code, it would be:

from seleniumbase import SB
        
with SB(uc=True) as self:
    self.driver.execute_cdp_cmd(
        "Browser.grantPermissions",
        {
            "origin": 'https://web.snapchat.com',
            "permissions": ["geolocation", "audioCapture", "displayCapture", "videoCapture",
                "videoCapturePanTiltZoom"]
        },
    )

    self.open("https://web.snapchat.com")
    self.type('input[name="username"]', username)
    self.type('input[name="password"]', password)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KolyStudio
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants