美文网首页爬虫
创建无头chrome的方法

创建无头chrome的方法

作者: sexy_cyber | 来源:发表于2018-03-20 21:54 被阅读121次

path = "C:/Users/Administrator/AppData/Local/Programs/Python/Python36/chromedriver.exe"

opt = webdriver.ChromeOptions()

# 把chrome设置成无界面模式

opt.add_argument('headless')

# 创建chrome无界面对象

driver = webdriver.Chrome(executable_path=path,chrome_options=opt)

相关文章

网友评论

    本文标题:创建无头chrome的方法

    本文链接:https://www.haomeiwen.com/subject/easiqftx.html