I tried to collect some text with selenium webdriver using python and I found that
something.text
collect empty string, but something.get_attribute(name="innerText")
collect value I want. Why is this happening ?
something = driver.find_element(By.CLASS_NAME, "block-mega-child-cats")
tag = something.find_elements(By.TAG_NAME, "a")
for i in tag:
print(i.get_attribute(name="innerText"))
This part of code works perfectly, but I can't understand why .text
doesn't.