title: Python Selenium On Local HTML String
body: <p>I am trying to run Selenium on a local HTML string but can't seem to find any documentation on how to do so. I retrieve HTML source from an e-mail API, so Selenium won't be able to parse it directly. Is there anyway to alter the following so that it would read the HTML string below:</p>
  
  <p>Python Code for remote access:</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  driver = webdriver.Firefox()
  driver.get("http://www.python.org")
  assert "Python" in driver.title
  elem = driver.find_element_by_class_name("q")
  </code></pre>
  
  <p>Local HTML Code:</p>
  
  <pre><code>s = "&lt;body&gt;
          &lt;p&gt;This is a test&lt;/p&gt;
          &lt;p class="q"&gt;This is a second test&lt;/p&gt;
       &lt;/body&gt;"
  </code></pre>