0
을 기본 URL로 시작하고, 셀 목록을 CSV 형식의 짧은 하위 목록 (예 : 20 열 중 하나 하위 도메인) 및 각 html 인쇄. 알아내는 데 어려움이 있습니다. 감사!(필자는 생각합니다.) 파이썬 루프를 통해 서브넷 목록에서 셀 륨
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)"
감사합니다. 구문을 개선하려고했지만 여전히 실행되지 않습니다. – KenBurnsFan1
그래, 그게 같지만 수업은. 같은 이름을 가진 많은 클래스를 생성하므로 결국 (unittest.main()을 실행할 때) 하나만 남게됩니다. – nosklo