[Python] Is it possible to run Selenium on Amazon EC2 instance without headless mode?

Discussão em 'Python' iniciado por Stack, Março 18, 2025.

  1. Stack

    Stack Membro Participativo

    I want to use Selenium to load a PDF page on an Amazon EC2 instance without using headless mode, since I want to load PDFs. Due to issues described here (https://github.com/puppeteer/puppeteer/issues/1872), headless Chrome won't load PDFs, but I am having general trouble getting Selenium Python to run on Chrome without adding the "headless" option (which looks something like this):

    options = Options()
    options.headless = True # I want to change this to False
    driver = webdriver.Chrome(options=options)


    If headless is set to False, it simply crashes and says something along the lines of

    (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.)


    Here is a guide that sets up Selenium on Amazon EC2, but it uses headless as well: https://praneeth-kandula.medium.com...in-python-on-an-aws-ec2-instance-2fb4ad633bb5

    Any tips/advice?

    Continue reading...

Compartilhe esta Página