I have just downloaded Anaconda (v 1.7.2) and spyder (Python 3.7.6). I have chrome (Version 81.0.4044.92 64-bit) Selenium version 3.141.0
When I write the code below I get the response that chrome opens up a new instance and a tab, but only the starting page, it never opens up the site I have pointed out. I have tried to close all other chrome instances also but that didn't help. I have added the following to the system environment variables C:\Users\aaa.bbb\Anaconda3\Scripts; c:\users\aaa.bbb\anaconda3\lib\site-packages\chromedriver;
from selenium import webdriver
from bs4 import BeautifulSoup
import pandas as pd
import time
driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
driver.get('http://www.aftonbladet.se');
time.sleep(3)
driver.quit()
The response I get in spyder is:
runfile('C:/Users/aaa.bbb/.spyder-py3/temp.py', wdir='C:/Users/aaa.bbb/.spyder-py3')
Traceback (most recent call last):
File "C:\Users\aaa.bbb\.spyder-py3\temp.py", line 8, in <module>
driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
File "C:\Users\aaa.bbb\Anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
self.service.start()
File "C:\Users\aaa.bbb\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 98, in start
self.assert_process_still_running()
File "C:\Users\aaa.bbb\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py", line 111, in assert_process_still_running
% (self.path, return_code)
WebDriverException: Service C:\Program Files (x86)\Google\Chrome\Application\chrome.exe unexpectedly exited. Status code was: 0
Please download latest chrome driver which support to your browser version : you can download Latest Chrome driver from here, Here r denotes relative path::
from selenium import webdriver
driver = webdriver.Chrome(executable_path=r" path to your chromedriver.exe")
driver.maximize_window()
baseUrl = "https://www.google.com"
driver.get(baseUrl)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments