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)
评论列表
文章目录