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")
source https://stackoverflow.com/questions/70454115/my-chromedriver-looks-like-text-file-on-mac
Comments
Post a Comment