title: Getting text data with .getAttribute in Selenium
body: <p>I'm trying to retrieve the text from a container/card text box on <a href="https://docs.google.com/forms/d/1MYSjxAMCXMXB02GPXqkewVx35_ptzv0XO7GRZQGwyGE/edit" rel="nofollow noreferrer">this Google form</a>. I basically want to retrieve the questions and related answers. </p>
  
  <p>I can retrieve the questions using css code but I don't know how to get the answers. The answers are included, more or less, in this type of code:</p>
  
  <pre><code>&lt;input type="text" class="quantumWizTextinputSimpleinputInput exportInput" jsname="YPqjbf" autocomplete="on" tabindex="0" aria-label="valeur d'une option" value="Doctor's availability in hotel" dir="ltr" data-initial-value="Doctor's availability in hotel"&gt;
  </code></pre>
  
  <p>Here the answer is:</p>
  
  <pre><code>data-initial-value="Doctor's availability in hotel"
  </code></pre>
  
  <p>Here we want to get:</p>
  
  <pre><code>data-initial-value="Doctor's availability in hotel"
  </code></pre>
  
  <p>So, I tried the next one with `.get_attribute':</p>
  
  <pre><code># I get all the letters with the questions and answers inside
  containers = driver.find_elements_by_class_name(
      "freebirdFormeditorViewItemContentWrapper"
  )
  questionnaire = {}
  # for each card
  for container in containers:
      try:
          question = container.find_element_by_css_selector(".exportTextarea[aria-label='Intitulé de la question']")
      except NoSuchElementException:
          print("NoSuchElementException in " + container)
          continue
      # Get the answers
      responses = container.find_elements_by_class_name(
          "quantumWizTextinputSimpleinputInput.exportInput"
      )
      print("responses: ", responses)
      extracted_responses = [response.get_attribute("data-initial-value") for response in responses]
  
      questionnaire[question.text] = extracted_responses 
  </code></pre>
  
  <p>But I don't get the answers:</p>
  
  <pre><code>responses:  []
  </code></pre>