<div class="SdTitle-sc-iwgcvh dmugDV title">#24 Information Revolution</div>
I want to get the text in this div. I was using this code:
title = driver.find_element_by_xpath("/html/body/div/div[2]/div[4]/div/div[2]/div[1]/div/div[1]").get_attribute("innerText")
But it returns an empty string, I tried text(), get_attribute("innerText"), get_attribute("innerHTML"). None of them works.
The element can be found by selenium. I also found this element with the xpath in chrome, which means the xpath is correct.
If I tried get_attribute('outerHTML'), it returns
<div class="SdTitle-sc-iwgcvh dmugDV title"></div>
This is so strange.
I searched on Chrome that the div with these classes only has 1.
Thank you for your help.