I'm trying to display text in what seems to be a container in web using selenium webdriver for python. Here is the inspect element -
<div style="overflow-x: hidden;">
<div class="view-container" style="flex-direction: row;
transition: all 0s ease 0s; transform: translate(0%, 0px); direction: ltr;
display: flex; will-change: transform;">
<div aria-hidden="false" data-swipeable="true" style="width: 100%; flex-
shrink: 0; overflow: auto;">
<div>
<div class="qs-text">What is the answer to this question?</div>
I want it to display "What is the answer to this question"
I'm trying to use the below, but it doesn't return anything. -
element = driver.find_element_by_class_name("qs-text").text
print(element)
I tried find_element_by_css_selector("qs-text").text
but that didn't help either.
Can you please tell me what I'm doing wrong