I am trying to create a program that opens a URL and then clicks on the "Memberships" button on that page. My program can open up the URL but doesn't locate or click on the membership button. I am new to code and can't find out what is wrong with the code. The code is below. Any help would be appreciated.
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.keys import Keys
s=Service("C:\Program Files (x86)\chromedriver.exe")
driver = webdriver.Chrome(service=s)
url='https://tickets.leedsunited.com/'
driver.get(url)
link = driver.find_element("Memberships")
link.click()
find_element
method should receive 2 arguments: locator type and value . Correct code should be
driver.find_element("link text", "Memberships").click()
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.