Hi, starting with a base URL, I'm trying to have selenium loop through a short list of subdomains in csv format (ie: one column of 20 subdomains) and printing the html for each. I'm having trouble figuring it out. Thanks!
from selenium import selenium
import unittest, time, re, csv, logging
subds = csv.reader(open('listofsubdomains.txt', 'rb'))
for subd in subds:
try:
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(subd[0])
html = sel.get_html_source()
print html
def tearDown(self):
self.selenium.stop()
self.assertEqual([], self.verificationErrors)
if __name__ == "__main__":
unittest.main()
except Exception, e:
print>>sys.stderr, "Url % not processed: error (%s) % (url, e)"