def __init__(self):
# store the url of homepage and the country code
self.home_url = "http://en.swisswebcams.ch"
self.geo_url = "http://map.topin.travel/?p=swc&id="
self.country = "CH"
# open the file to store the list and write the format of the list at the first line
self.f = open('list_swissWebcam.txt', 'w')
self.f.write("country#city#snapshot_url#latitude#longitude" + "\n")
# open the Firefox
firefox_profile = webdriver.FirefoxProfile()
firefox_profile.set_preference("browser.download.folderList", 2)
firefox_profile.set_preference("javascript.enabled", False)
self.driver = webdriver.Firefox(firefox_profile=firefox_profile)
# wait object to use
self.wait = ui.WebDriverWait(self.driver, 10)
评论列表
文章目录