I'm new to Chrome headless and I have a problem.

I want to randomly select two links from a web page on the page being viewed and open them at the same time.

Indeed my goal is to be able to have the screenshots of the three pages using Selenium with Chrome headless the one currently being viewed and the other two open.

The following code already gives me the screenshots script of the current page.

 from selenium import webdriver
chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome('/home/leonel/projet_/chromedriver')


  • 1
    Is it multithreaded ? Jun 26, 2019 at 20:33
  • I have my URL database and I want that after opening a page, I can have the possibility to have the screenshot of other pages in the same domain. So getting out of it Chrome headless must give me the screenshot of each page. So for one URL I have three screenshot coming out. If there are sites in JS that do not allow this, so much the better. I have several URLs and I thought there is certainly something that could allow this. Jun 27, 2019 at 0:31
  • Selenium cannot work like this. You can have one page active and take a screenshot of it, but you cannot have a screenshot of 3 windows at the same time as selenium has only one active window at the given point. You are able to open 3 windows and then switch between them and take 3 different pictures. Jul 1, 2019 at 8:53


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.