title: How to apply Loop to working Python Selenium Script?
body: <p>I'm trying to figure out how to apply a for-loop to this script and I'm having a lot of trouble.  I want to iterate through a list of subdomains which are stored in csv format (ie: one column with 20 subdomains) and print the html for each.  They all have the same SourceDomain.  Thanks!</p>
  
  <pre><code>#Python 2.6
  from selenium import selenium
  import unittest, time, re, csv, logging
  
  class Untitled(unittest.TestCase):
      def setUp(self):
          self.verificationErrors = []
          self.selenium = selenium("localhost", 4444, "*firefox", "http://www.SourceDomain.com")
          self.selenium.start()
  
      def test_untitled(self):
          sel = self.selenium
          sel.open("/dns/www.subdomains.com.html")
          sel.wait_for_page_to_load("30000")
          html = sel.get_html_source()
          print html
  
      def tearDown(self):
          self.selenium.stop()
          self.assertEqual([], self.verificationErrors)
  
  if __name__ == "__main__":
      unittest.main()
  </code></pre>