可以在没有无头模式的情况下在Amazon EC2实例上运行硒?

问题描述 投票:0回答:1

我想使用硒在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.)

在这里,它是在Amazon EC2上设置硒的指南,但它也使用了无头:
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的实例中无头跑
python amazon-web-services selenium selenium-webdriver selenium-chromedriver
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.