Setting Up Browser Connection with Selenium in Python
from selenium import webdriver
Remember to use "//" instead of "\" in webdriver address.
Dont use .exe for webdriver
from selenium.webdriver.chrome.service import Service
#service_obj = Service("C://Users//ancha//geckodriver-v0.33.0-win64//geckodriver")
#C://Users//ancha//chromedriver_win32(4)
#C:\Users\ancha\edgedriver_win64//msedgedriver.exe
driver= webdriver.Firefox(service= service_obj)
driver.maximize_window()
driver.get("http://www.google.com")
print(driver.current_url)
print(driver.title)
driver.get("https://www.google.com/search?q=testing+jobs&sxsrf=APwXEdd5rDTPfVp7w87eJ2w8wfizSDOcyw%3A1681214481103&source=hp&ei=EUw1ZObXA8Tn2roPmZ27yAw&iflsig=AOEireoAAAAAZDVaId2RVarb43dg4_rYWDvSfcI4-hXY&ved=0ahUKEwimpL3_46H-AhXEs1YBHZnODskQ4dUDCAk&uact=5&oq=testing+jobs&gs_lcp=Cgdnd3Mtd2l6EAMyCAgAEIAEELEDMgUIABCABDIFCAAQgAQyBQgAEIAEMgUIABCABDIICAAQgAQQsQMyBQgAEIAEMgUIABCABDIFCAAQgAQyBQgAEIAEOgcIIxDqAhAnOggIABCKBRCRAjoLCAAQgAQQsQMQgwE6CwgAEIoFELEDEIMBOhEILhCABBCxAxCDARDHARDRAzoLCC4QgAQQsQMQgwE6DggAEIoFELEDEIMBEJECOg4ILhCABBCxAxDHARDRAzoFCC4QgAQ6CAgAEIAEEMkDOggIABCKBRCSA1CQFVi0LGDbL2gBcAB4AIAB1wKIAc4TkgEHMC43LjIuM5gBAKABAbABCg&sclient=gws-wiz")
driver.minimize_window()
#driver.back()
#driver.refresh()
#driver.close()
Comments
Post a Comment