How do I run ChromeDriver on Mac?
I am trying to automate some webpage scraping using Selenium webdriver on Mac.
I found many questions about this, some said ChromeDriver need to be installed but it is not installed in my mac, few people said Google Chrome browser should run on MacOS. But in fact, Chromedriver does not run.
Here is the error: Traceback (most recent call last): File "C:Python34libsite-packagesseleniumwebdriverremotewebdriver.py", line 459, in execute self.errorhandler.checkresponse(response)
File "C:Python34libsite-packagesseleniumwebdriverremoteerrorhandler.py", line 194, in checkresponse raise exceptionclass(message, screen, stacktrace). Selenium.common.exceptions.NoSuchSessionError: Message: no such session
From selenium.desiredcapabilities import DesiredCapabilities from selenium.support.ui import WebDriverWait
From selenium.support import expectedconditions as EC from selenium import webdriver. Chromedriver = "C:Program Files (x86)GoogleChromechromedriver". If platform == 'Linux': # Linux and Mac OS. # download and install chromedriver. import subprocess as sp. w = sp.wait() print "Downloading chromedriver." w.stdout.readinto(f)
Why is ChromeDriver not opening Chrome on Mac?
I recently updated to MacOS Mojave 10.
14.5 (High Sierra). When I use Selenium 3.141.0 (Chrome 75) to launch Chrome for me, it opens with the same default profile as when I was running Mojave, but using the Safari browser. Why is it not opening Chrome and what are my options? I am using the latest version of Node 10.9.0, ChromeDriver 75.3770.142, and Chrome 75.142 on Windows.
This occurs when there is no Profile/Chrome/Path specified and a "use system default" is set. The system default is Safari with an empty profile.
Set profile via --capabilities. If you have a default profile, you can do the following from within Chrome: ChromeUtils.setDefaultProfile() OR
ChromeOptions.Builder builder = new ChromeOptions.Builder();
Builder.addUserProfileConfig("profile.Default", Collections.emptyList());
Use --no-sandbox if you are concerned about security. You may also have a sandbox enabled by default in the OS. See issue 72385 for more details.
Related Answers
How to run Selenium Python in Chrome?
As the title said, I would like to know how to import Chrome...
How to add ChromeDriver to path?
I'm trying to ma...
How do I update ChromeDriver?
I have a python script which downloads some webpages and then...