selenium出错: 类型转换失败

selenium出错: 类型转换失败

driver = webdriver.Chrome(Chromedriver_path, chrome_options)

File "E:Anacondalibsite-packagesseleniumwebdriverchromewebdriver.py", line 73, in init

self.service.start()

File "E:Anacondalibsite-packagesseleniumwebdrivercommonservice.py", line 71, in start

cmd.extend(self.command_line_args())

File "E:Anacondalibsite-packagesseleniumwebdriverchromeservice.py", line 46, in command_line_args

return ["--port=%d" % self.port] + self.service_args

TypeError: %d format: a number is required, not Options

`

Chromedriver_path = 'C:/Program Files(x86)/Google/Chrome/Application/chromedriver.exe'

chrome_options = webdriver.ChromeOptions()

chrome_options.add_argument('--headless')

chrome_options.add_argument('--disable-gpu')

driver = webdriver.Chrome(Chromedriver_path, chrome_options)`

第五行代码报错

报了 self.port 无法转换成 %d 的形式


回答:

int(self.port) ?

以上是 selenium出错: 类型转换失败 的全部内容, 来源链接: utcz.com/p/937668.html

回到顶部