0

How can I find this element? I am using selenium and coding in python.

These are the elements details:

Xpath = //*[@id="545711682"] 
CSS-selector = #\35 45711682

This is what I have tried so far:

driver.find_element_by_xpath('//*[@id="545711682"]')
driver.find_element(By.XPATH, '//*[@id="545711682"]')

When I use elements instead of element the code doesn't fail, but I am assuming I find bunch of elements instead of one and thats why its not clickable.

Here is the link, and these is the html part that I am trying to find:

When selected:

<a href="#" class="lc_rm_a lc_rm_t" data-seq="33526109" id="545711682" onclick="return showBookingForm(this.id,'4705','12:00pm - 12:30pm, Tuesday, June 13, 2017', '30');" style="width: 30px; float:left; display:block;" title="4705, 12:00pm to 12:30pm, Tuesday, June 13, 2017">&nbsp;</a>

When not selected:

<a href="#" class="lc_rm_a" data-seq="33526109" id="545711682" onclick="return showBookingForm(this.id,'4705','12:00pm - 12:30pm, Tuesday, June 13, 2017', '30');" style="width: 30px; float:left; display:block;" title="4705, 12:00pm to 12:30pm, Tuesday, June 13, 201
7">&nbsp;</a>
5
  • instead of the picture of the site, please include the link itself, thank you. Commented Jun 9, 2017 at 23:02
  • This is the link gmu.libcal.com/booking/FenStudy6 and this is the html part <a href="#" class="lc_rm_a lc_rm_t" data-seq="33526109" id="545711682" onclick="return showBookingForm(this.id,'4705','12:00pm - 12:30pm, Tuesday, June 13, 2017', '30');" style="width: 30px; float:left; display:block;" title="4705, 12:00pm to 12:30pm, Tuesday, June 13, 2017">&nbsp;</a> Commented Jun 9, 2017 at 23:03
  • I'm new here, and trying to get hold of how to post properly. did you get the information or is it clear? Commented Jun 9, 2017 at 23:13
  • Sorry friend, I became busy on another work matter. But yes, I have understood your question, I'm glad you found an answer. Commented Jun 9, 2017 at 23:56
  • Thank you Jeremy. Commented Jun 11, 2017 at 21:05

1 Answer 1

1

The issue was that the element wasn't present when I was looking for it

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

and this is the code that got it done:

wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="545711682"]'))).click()
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.