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() chrome_options.add_argument('--headless') driver = webdriver.Chrome('/home/leonel/projet_/chromedriver') driver.get('https://openclassrooms.com/forum/sujet/ouvrir-un-lien-cliquable-present-sur-une-page-web#93235610') driver.get_screenshot_as_file('/home/leonel/projet_/screenshot.png') print(driver.title)
Thank you in advance.