0

I am building a crawling code on a web page running only on IE11.

My problem is that python selenium,selenium.webdriver.Ie, find completely different element of HTML

element = driver.find_element_by_xpath("//*[text()='1']") 

I look for element which text is 1 on the calendar and element.text's output is also 1 in juypter notebook like picture. enter image description here (I can't be embedded because I'm a Newbie. I'm sorry.)

But if i operate element.click() in browser(driver, HTML),18 is clicked in browser. enter image description here Why did my code operate like this?

5
  • Update the question with the relevant HTML of the element. Commented Dec 21, 2021 at 10:17
  • Thanks for advise! Did you say that I need to add HTML to tag?
    – Chan
    Commented Dec 22, 2021 at 9:30
  • Add the HTML part you expect to find, and the HTML part you actually find. That could help spotting the problem
    – g_uint
    Commented Dec 22, 2021 at 9:39
  • Thank you for advise ! I added a picture to help understand. but i'm newbie, i could add only link to picture.
    – Chan
    Commented Dec 23, 2021 at 2:43
  • Have you tried adding specific tags in the selector? Something like this: element = driver.find_element_by_xpath("//a[text()='1']") . If possible, could you provide sample code of the HTML Table element or the link to this webpage so that we can reproduce the problem? Thank you for your understanding. Commented Dec 24, 2021 at 3:30

0