I'm doing some scraping and automation using selenium. My question is exactly what I putted on the title. Say I have something like:
<div id = "dsopdoaspdk"><div id = "owpowqkeqwop"><div id = "wewqopewqkeop"><div class = "kdmkdmqwopeop"><span class = "wopqqwope"><a id = "dlopkeop">
and I want to get only the a class for clicking in the link. On the XPATH I have to put all the divs nested or can I get something like getting only the most outer div("dsopdoaspdk") and the <a id? or, better, can I get something like find_element(By.ID, "dlopkeop") ignoring all the divs?
I'm trying to reduce the amount of code not putting all these long div class names.