title: Get dynamically generated content with python Selenium
body: <p>This question has been asked before, but I've searched and tried and still can't get it to work. I'm a beginner when it comes to Selenium.</p>
  <p>Have a look at: <a href="https://finance.yahoo.com/quote/FB" rel="nofollow noreferrer">https://finance.yahoo.com/quote/FB</a></p>
  <p>I'm trying to web scrape the &quot;Recommended Rating&quot;, which in this case at the time of writing is 2. I've tried:</p>
  <pre><code>driver.get('https://finance.yahoo.com/quote/FB')
  time.sleep(10)
  rating = driver.find_element_by_css_selector('#Col2-4-QuoteModule-Proxy &gt; div &gt; section &gt; div &gt; div &gt; div')
  print(rating.text)
  </code></pre>
  <p>...which doesn't give me an error, but doesn't print any text either. I've also tried with xpath, class_name, etc. Instead I tried:</p>
  <pre><code>source = driver.page_source
  print(source)
  </code></pre>
  <p>This doesn't work either, I'm just getting the actual source without the dynamically generated content. When I click &quot;View Source&quot; in Chrome, it's not there. I tried saving the webpage in chrome. Didn't work.</p>
  <p>Then I discovered that if I save the entire webpage, including images and css-files and everything, the source code is different from the one where I just save the HTML.</p>
  <p><img src="https://i.stack.imgur.com/AmgBr.jpg" alt="Image" /></p>
  <p>The HTML-file I get when I save the entire webpage using Chrome DOES contain the information that I need, and at first I was thinking about using pyautogui to just Ctrl + S every webpage, but there must be another way.</p>
  <p>The information that I need is obviosly there, in the html-code, but how do I get it without downloading the entire web page?</p>