0

I'm writing a web extension in Typescript.

I want to insert a custom element at the end of a div element on the page. But the div does not have an id. The only way I can think of addressing it is with the XPath:

/html/body/div[7]/div[3]/div/div[2]/div[1]/div[2]/div/div/div/div/div[1]/div[2]/div[1]/div

Thanks for helping me out

etw0
  • 23
  • 5
  • can you please share the html of div and it's parent div. – supputuri Feb 17 '20 at 17:29
  • May be something you can salvage from here: https://stackoverflow.com/questions/52465472/xpath-get-child-elements-typescript-javascript – JGFMK Feb 17 '20 at 17:33
  • Check this answer: https://stackoverflow.com/questions/10596417/is-there-a-way-to-get-element-by-xpath-using-javascript-in-selenium-webdriver You can select the element by XPath. – Roman Feb 17 '20 at 17:42

0 Answers0