title: Unable to read text from a div tag in python
body: <p><code>for position in driver.find_elements_by_xpath("//div[@class='d3-tip n']"):
                          style = position.get_attribute('style')
                          opacity = style[:32]
                          if opacity == "position: absolute; opacity: 1;":
                             tooltipmessage = driver.find_element_by_xpath('//div[contains(@style,"%s")]' % opacity)
                             time.sleep(3)
                             print tooltipmessage.text</code>I have 2 div tags with the same class ("d3-tip n"). When I hover the mouse the Opacity changes to "1" in the style attribute and I want to print the text from that div tag. </p>
  
  <p>I wrote the following code and for some reason it does not print anything. </p>
  
  <p>NOTE - I also tried position.text and that doesn't work either.</p>
  
  <p>Attached is the HTML code that shows the 2 div items with the same class and the one with the SQL query is the text I want to print.
  <img src="https://i.stack.imgur.com/7hIH1.png" alt="enter image description here"></p>
  
  <pre><code>for position in driver.find_elements_by_xpath('//div[@class="d3-tip n"]'):
                      style = position.get_attribute('style')
                      opacity = style[:32]
                      if opacity == "position: absolute; opacity: 1;":
                         print position
  </code></pre>