insecam.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:CAM2RetrieveData 作者: PurdueCAM2Project 项目源码 文件源码
def __init__(self):
        # store the url of homepage, traffic page, the country code, and the state code
        self.home_url = "http://www.insecam.org"
        self.traffic_url = "http://www.insecam.org/"

        # open the file to store the list and write the format of the list at the first line
        self.us = open('list_insecam_US.txt', 'w')
        self.us.write("city#country#state#snapshot_url#latitude#longitude" + "\n")

        self.ot = open('list_insecam_Other.txt', 'w')
        self.ot.write("city#country#snapshot_url#latitude#longitude" + "\n")

        # open the web-driver
        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)

        # list of categories that it will parse and list of image URLs that should not be parsed
        self.categories = ['City', 'Village', 'River' 'Square', 'Construction', 'Bridge', 'Nature', 'Mountain', 'Traffic', 'Street', 'Road', 'Architecture', 'Port', 'Beach']
        self.invalid = ['http://admin:@50.30.102.221:85/videostream.cgi',
                        'http://198.1.4.43:80/mjpg/video.mjpg?COUNTER',
                        'http://97.76.101.212:80/mjpg/video.mjpg?COUNTER',
                        'http://24.222.206.98:1024/img/video.mjpeg?COUNTER',
                        'http://71.43.210.90:80/SnapshotJPEG?Resolution=640x480&Quality=Clarity&1467044876',
                        'http://61.149.161.158:82/mjpg/video.mjpg?COUNTER',
                        "http://213.126.67.202:1024/oneshotimage1",
                        "http://71.90.110.144:8080/img/video.mjpeg?COUNTER",
                        "http://95.63.206.142:80/mjpg/video.mjpg?COUNTER",
                        "http://201.229.94.197:80/mjpg/video.mjpg?COUNTER"
                       ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号