解决selenium报错unknown error: DevToolsActivePort file doesn't exist

添加代码

opt = Options()
opt.set_headless()
opt.add_argument('--no-sandbox')   # 让Chrome在root权限下跑
opt.add_argument('--disable-dev-shm-usage')
opt.add_argument('--headless')
opt.add_argument('blink-settings=imagesEnabled=false')
opt.add_argument('--disable-gpu')

你可能感兴趣的:(Scrapy)