Open lobatim opened 3 years ago
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.
Same problem. same errors.
Do you have Chrome installed?
selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.18363 x86_64)
i have the same exact problem. i hope i will find someone that can fix that issue
How to fix:
open webbot.py with a text editor
Change
def __init__(self, showWindow=True, proxy=None , downloadPath:str=None):
into
def __init__(self, showWindow=True, proxy=None , downloadPath:str=None, executable_path:str=None):
then replace the block
driverfilename = ''
if sys.platform == 'linux' or sys.platform == 'linux2':
driverfilename = 'chrome_linux'
elif sys.platform == 'win32':
driverfilename = 'chrome_windows.exe'
elif sys.platform == 'darwin':
driverfilename = 'chrome_mac'
driverpath = os.path.join(os.path.split(__file__)[0], 'drivers{0}{1}'.format(os.path.sep, driverfilename))
with
if executable_path:
driverpath = executable_path
else:
driverfilename = ''
if sys.platform == 'linux' or sys.platform == 'linux2':
driverfilename = 'chrome_linux'
elif sys.platform == 'win32':
driverfilename = 'chrome_windows.exe'
elif sys.platform == 'darwin':
driverfilename = 'chrome_mac'
driverpath = os.path.join(os.path.split(__file__)[0], 'drivers{0}{1}'.format(os.path.sep, driverfilename))
Now you can pass the location of your chromedriver binary in the call to Browser(), like:
web = Browser(executable_path=r'C:\Users\You\chromedriver.exe')
Use a raw string (r'') if you use backslashes in the path. Otherwise you can use a regular string.
that seems to help but it causes another error:
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: crashed.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location C:\Users\pgame\AppData\Local\Google\Chrome\Application\chrome.exe is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
When I execute function browser() I get his error, someone can help me ?