1

参考解决方案:Chromedriver Save as PDF method not working

在显示 Ctrl+P 以保存到 PDF 时出现问题,屏幕显示所有字段均已禁用,并将立即关闭。我正在使用上述 URL 中提供的解决方案。除非我使用下面的代码以及您提供的代码来禁用 cookie,否则它曾经完美地工作过。

我正在使用 Chrome 驱动程序版本:85.0.4183.102

有没有因为这个而产生冲突。

experimentalFlags = ['same-site-by-default-cookies@2', 'cookies-without-same-site-must-be-secure@2']
chromeLocalStatePrefs = {'browser.enabled_labs_experiments': experimentalFlags}
chrome_options.add_experimental_option('localState', chromeLocalStatePrefs)

请在这方面帮助我。谢谢

4

0 回答 0