我想使用硒在Amazon EC2实例上加载PDF页面,因为我想加载PDFS,因此使用无头模式加载PDF页面。由于此处描述的问题(https://github.com/puppeteer/puppeteer/issues/1872),无头铬不会加载pdfs,但是我遇到了一般的麻烦,让selenium python在Chrome上运行Chrome而不添加“ Headless”选项(看起来像这样的东西)
options = Options()
options.headless = True # I want to change this to False
driver = webdriver.Chrome(options=options)
如果无头设置为false,它只是崩溃并按照的线条说一些话。
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
https://praneeth-kandula.medium.com/running-chromedriver-and-selenium-and-selenium-in-python-in-python-on-an-aws-an-aws-ec2-instance-c2-instance-2fb4ad6333bbb5
为此解决任何解决方案吗?想要在AWS Ubuntu的实例中无头跑