Can you extract driver reference from WebElement?

Viewed 14

Python - Selenium

I have a recursive function where I pass the driver parameter.

Sometimes I pass WebElement instead of driver to make it the root element for the next search.

driver.find_element is slow, so I rewrote it in JS. However, for that I seem to need both the driver reference as well as the WebElement reference.

Is there a way to get a pointer to the driver object which created a specific WebElement variable?

0 Answers
Related