Home > Net >  Find Element in Selenium (Python) not possible due to multiple html tags
Find Element in Selenium (Python) not possible due to multiple html tags

Time:02-20

Hi :) This is my first time here and I am new to programming.

I am currently trying to automate some work-steps, using Selenium.

There was no problem, mainly using the find_element(By.ID,'') function and clicking stuff.

But now I cannot find any element that comes after the second "html" tag on the site (see screenshot)

Inspector

I tried to google this "multiple html" problem, but all I found was people saying it is not possible to have multiple html tags. I basically don't know anything about html, but this site seems to have more than one - there are actually three. And anything after the first one cannot be subject to the find_element function. Please help me with this confusion.

CodePudding user response:

Try using Xpath. it will help you to get the perfect Id.

CodePudding user response:

These "multiple html" are due to the i frames in the html code. Each iframe has its own html code. If the selector you are using is meant to find something inside one of these iframes you have to "move" your driver inside the iframe. You can find an example in this other question

  • Related