0

Hi all, I just started selenium with python. I want to use chrome-driver in my project but it looks like a text file in PayCharm? I am totally new to python. Please see the below screenshots.

enter image description here

Here is my code

from datetime import time

from selenium import webdriver

driver = webdriver.Chrome("../drivers/chromedriver")

# driver = webdriver.Firefox("../drivers/geckodriver")

driver.set_page_load_timeout(10)

driver.get("https://www.google.se")

driver.find_element_by_id("L2AGLb").click()

driver.find_element_by_name("q").send_keys("Automation step by step")

driver.find_element_by_name("btnK").click()

time.sleep(2)

driver.close()

driver.quit()

print("Test Completed")

This code opens the firfox. Click on accept cookies button, then search for the text and even the search text appears. But the following part of code doesn't work and I get the error DeprecationWarning: executable_path has been deprecated, please pass in a Service object driver = webdriver.Chrome("../drivers/chromedriver")

time.sleep(2)

driver.close()

driver.quit()

print("Test Completed")
Kahn
  • 279
  • 4
  • 16

0 Answers0