I'm trying to use Selenium in Python to send sms using my Dlink DWR-921 router. But I can't select any element on the document
. I tried td
, table
, body
but none of them works. I also tried on browser javascript for the above elements as well. Using document.getElementsByTagName()
, but I get empty HTMLCollection
. May I know why the element in the page is not selectable?
Update: To ensure the dom last been properly and fully loaded. I took a screenshot and confirmed that the DOM has been loaded everytime it run. Router model: DLink DWR-921
SW Version: V01.01.3.016
CodePudding user response:
Try to look for an input tag.
Also, it may be that the elements are inside an Iframe. Selenium doesn't "know" how to locate elements inside iframes, so you need to tell me to go into the iframe:
driver.switchTo().frame("firstframe");
or
driver.switchTo().frame(0);