LocationCrawler.py 文件源码

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

项目:InstagramLocationScraper 作者: VoodaGod 项目源码 文件源码
def __init__(self, profilePath, driverPath):
        options = webdriver.ChromeOptions()
        prefs = {"profile.managed_default_content_settings.images":2}
        options.add_argument("user-data-dir=" + profilePath)
        options.add_argument("headless")
        options.add_argument('window-size=1920x1080')
        options.add_experimental_option("prefs", prefs)

        try:
            self.driver = webdriver.Chrome(executable_path=driverPath, chrome_options=options)
        except WebDriverException:
            print("failed to start driver at " + driverPath)
            self.inUse = True #scraper with no driver is not ready to handle new job
            #traceback.print_exc()

        self.inUse = False #if False, is ready to handle new job
        self.bannerClosed = False #email banner only needs to be closed on first load
        self.timeLimit  = datetime.now() + timedelta(minutes=TIMEOUT_MINUTES)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号