Skip to content
Advertisement

While working with selenium, an error showed which was saying that ‘import “selenium” couldn’t be resolved.’

I dont’ find a problem in my code and it is showing another problem which is – :

driver = webdriver.Chrome(excutable_path=’C:Program Fileschromedriver.exe’) TypeError: init() got an unexpected keyword argument ‘excutable_path’

   import openpyxl as xl
from selenium import webdriver
from selenium.webdriver.common.keys import keys

driver = webdriver.Chrome(excutable_path='C:Program Fileschromedriver.exe')

wb = xl.load_workbook('Sample.xlsx')
sheet_1 = wb["Sheet1"]
cell_1 = sheet_1["b2"]
cell_2 = sheet_1["c2"]
cell_3 = sheet_1["d2"]
cell_4 = sheet_1["d2"]

driver.get('http://ritulpatwa.com/')

name = driver.find_element_by_name('na')
name.send_keys(cell_1)
name.send_keys(keys.RETURN)

mail = driver.find_element_by_name('em')
mail.send_keys(cell_2)
mail.send_keys(keys.RETURN)

phone = driver.find_element_by_name('ph')
phone.send_keys(cell_3)
phone.send_keys(keys.RETURN)

query = driver.find_element_by_name('quer')
query.send_keys(cell_4)
query.send_keys(keys.RETURN)

Advertisement

Answer

You are using excutable_path instead of executable_path.

try something like this :

executable_path = r"C:\etc\Inc\Desktop\Selenium+Python\chromedriver.exe"
driver = webdriver.Chrome(executable_path)
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement