I am currently writing a script for browser automation using selenium and I need to click a button on a webpage. I have successfully found and identified a bunch of buttons to press using driver.find_element(By.ID,'name').click()
but when I get to one of the buttons I need to press there is no ID and this is the full element: <a tabindex="-1" href="/miscOperations/theWall?dash=true">The Wall</a>
I am running into issues using the By.XPATH function of find element because of the '?' within the href. Is there anyway to search for the string "The Wall" and find the element? I think this would be my solve since it is a unique ID within the HTML but I am not sure how to find a certain string within the HTML. Another way I could possibly do it is to find a way to put the '?' character into Python without causing a syntax error due to the character itself even though its within a string.
Do you guys have an idea on the best way to go about this?
Thanks so much!