I'm facing a issue when I try to get element inside of an element. I tried 2 methods to achieve this but unfortunately didn't get success.
element_list = driver.find_elements_by_xpath("//div[@class='WGGO WKFO']//ul//li[@class='WO0F WHHO WI5 WF2F']//div[@class='WP0F WN0F']//div[@class='WDQY']//ul[@class='WHDR WCQY']")
above code get all the list of DOM elements list.
Method 1:
for element in element_list:
element_text = element.find_element_by_xpath("//div[@class='WP0F WN0F']//div[@class='WDQY']//ul[@class='WHDR WCQY']").text
print(element_text)
when I tried this it always return me first element's text instead of respective element text.
while searching I found a link where someone asked same as I want.
when I tried p0deje's
Answer it gives me blank array.
element_text = element.find_elements_by_xpath(".//div[@class='WP0F WN0F']//div[@class='WDQY']//ul[@class='WHDR WCQY']").text
Result: []
please suggest me what can I do to achieve this, How can I get an element detail inside an element?