我正在尝试安装Chrome,驱动程序需要包含一个有效负载:
payload={
'response_type': 'code',
'redirect_uri': config.redirect_uri,
'client_id': client_code,
}
#
## Print chrome_options
# print(get_chrome_options())
#
## Open browser window to authenticate using User ID and Password
browser = webdriver.Chrome(config.chrome_driver_path, options=self.get_chrome_options(), params=payload)
这产生了一个错误:
got an unexpected keyword argument 'params'
是否可以与驾驶员一起发送有效载荷?
@jared-我这么做是出于无知。我设法通过使用查询字符串/参数解决了这个问题:
url_encoded_client_code = urllib.parse.quote(client_code)
url_with_qstrings = "https://url?response_type=code&redirect_uri=http%3A%2F%2Flocalhost&client_id=url_encoded_client_code"
browser = webdriver.Chrome(config.chrome_driver_path, options=self.get_chrome_options())
browser.get(url_with_qstrings)