Error when using Selenium WebDriver in Python

0

I'm trying to develop a script in Python that simply opens the browser as shown in this Selenium with Chrome , but every time I try to run the program I come across the following error:

  

navigator = webdriver.Chrome () AttributeError: module   'selenium.webdriver' has no 'Chrome' attribute

The full code is below:

from selenium import webdriver driver = webdriver.Chrome('C:\Program
Files (x86)\Google\Chrome\Application\chrome.exe')

IDE: PyCharm.

NOTE: I've already downloaded ChromeDriver and reinstalled Selenium several times.

    
asked by anonymous 20.07.2018 / 09:48

2 answers

0

I've exactly used this link code you submitted. I'm using visual studio with version 3.6 of Python. In this you just need to install the selenium via pip and download the chrome driver. Extract the exe and poes into a folder of your choice. I put it in a paw called "C: \ Bin". The resulting code is identical to yours but with the difference that you should point to the chrome driver and not to the chrome exe.

driver = webdriver.Chrome('C:\Bin\chromedriver.exe') 

You can find the download driver here: on the google page for this purpose.

    
20.07.2018 / 10:58
0

Here is the code I use:

from selenium import webdriver
self.driver = webdriver.Chrome('C:\chromedriver.exe')
self.driver.get("http://www.google.com")

If you attempt to use two slashes in the path.

    
26.07.2018 / 22:07