utils.py 文件源码

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

项目:Needl 作者: eth0izzle 项目源码 文件源码
def get_browser():
    chromedriver = os.path.join(needl.args.datadir, 'chromedriver')
    if not os.path.exists(chromedriver):
        raise FileNotFoundError("Could not find chromedriver executable at %s. Download it for your platform at https://chromedriver.storage.googleapis.com/index.html?path=2.33/", chromedriver)

    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_argument('headless')
    chrome_options.add_argument('window-size=1024x3000')
    chrome_options.add_argument("user-agent=" + get_line(os.path.join(needl.args.datadir, 'user-agents.txt')))

    return webdriver.Chrome(executable_path=chromedriver, chrome_options=chrome_options)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号