Skip to content

What is the equivalent of the 'set_capability' function from Selenium? #282

@0xPatryk

Description

@0xPatryk

Hi, I want to set up Browserless v1 with ThirtyFour, but in order to connect to Browserless, I need to set the token. In Selenium, the token is set using the set_capability method on the ChromeOptions object.

I've tried setting the token with add_args and inserting browser options, but this is not the same. How can I achieve this, since the token is required for the self-hosted Docker?

I'm currently getting a '403 unauthorised' error, even when the token does match.

### Selenium Code Example:

from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless') 
options.add_argument('--no-sandbox') 
options.set_capability('browserless:token', '<token found in logs>')
driver = webdriver.Remote(
    command_executor='http://localhost:3000/webdriver',
    options=options,
)

Related GitHub issue in Browserless:
browserless/browserless#3495 (comment)

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