def __init__(self):
# store the url of homepage, traffic page, the country code, and the state code
self.home_url = "https://www.theweathernetwork.com"
self.json_url = "https://www.theweathernetwork.com/api/maps/trafficcameras/9/43.84598317236631/-80.71453475531251/43.048384299427234/-78.72600936468751"
self.country = "CA"
self.state = ""
# open the file to store the list and write the format of the list at the first line
self.list_file = open('list_Canada_weatherNetwork.txt', 'w')
self.list_file.write("city#country#snapshot_url#latitude#longitude" + "\n")
# open the browser
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)
Weather_Network.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录