1
votes

I'm running a selenium script on my raspberry pi (my raspberry pi is running the latest version of Raspbian OS). Since chrome isn't on Raspbian OS, I installed the chromedriver using this command sudo apt-get install chromium-chromedriver.

I was wondering how I could first create a chromium profile via the terminal, then how I could run my selenium script only using that profile.

I know on windows I'd have to add the following arguments, but what would I have to do for my selenium script on my raspberry pi?:

options.add_argument(r"user-data-dir=C:\Users\jack_l\AppData\Local\Google\Chrome\User Data")
options.add_argument(r'profile-directory=Profile 3')

And here's what I have so far for my raspberry pi selenium script:

options = Options()
options.BinaryLocation = "/usr/bin/chromium-browser"
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
driver_path = "/usr/bin/chromedriver"
driver = webdriver.Chrome(options=options, service=Service(driver_path))

Again, this runs succesfully, but not within any specific chrome profile.

Any help would be greatly appreciated, thank you.