I am doing a script to run Python Selenium and copy some content to clipboard. It has been working nice until I ran it in headless mode. Now it does not copy the text to the clipboard.
Does anyone know how to solve this?
Here it is my configuration
options = webdriver.ChromeOptions()
options.add_experimental_option("prefs", {
"download.default_directory": indir,
"download.prompt_for_download": False,
"download.directory_upgrade": True,
"safebrowsing.enabled": True})
options.add_argument('--headless')
options.add_argument('--disable-gpu')
driver = webdriver.Chrome(chrome_options=options)
I saw something about setting the capabilities but I couldn't fit this in my code, I get a SyntaxError: invalid syntax
.