You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when I run my code with headless turned off it works perfectly, but when I run it with headless it can't find the elements, I asked it to save the html of the page that headless is locking and it returns to the captcha page, so I assume it's not managing to solve the captcha in headless mode, does anyone have a solution?
options = uc.ChromeOptions()
# options.add_argument('--no-sandbox') # Bypass OS security model
# options.add_argument('--disable-dev-shm-usage') # Overcome limited resource problems
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--disable-gpu') # Adicione esta linha
#options.add_argument('--headless')
brave_path = r'C:\Users\Teste\hml\selenium\Brave-Browser\Application\brave.exe'
options.binary_location = brave_path
driver = uc.Chrome(options=options)
driver.get('https://www.emailnator.com/')
time.sleep(30)
try:
driver.find_element('xpath', '//*[@id="custom-switch-domain"]').click()
print("Clique no botão de login realizado com sucesso!")
except Exception as e:
html_content = driver.page_source
# Salva o HTML em um arquivo
with open("pagina_salva.html", "w", encoding="utf-8") as file:
file.write(html_content)
print("HTML da página foi salvo em 'pagina_salva.html'.")
# Fecha o driver após a execução
driver.quit()
print("Erro ao clicar no botão:")
driver.find_element('xpath', '//*[@id="custom-switch-plusGmail"]').click()
The text was updated successfully, but these errors were encountered:
I patched headless mode of Undetected Chromedriver and NoDriver into https://github.com/seleniumbase/SeleniumBase.
(See the UC Mode and CDP Mode docs.)
Lots of updates, such as an ad-block option, etc.
Here's a script for headless mode: (After pip install seleniumbase)
when I run my code with headless turned off it works perfectly, but when I run it with headless it can't find the elements, I asked it to save the html of the page that headless is locking and it returns to the captcha page, so I assume it's not managing to solve the captcha in headless mode, does anyone have a solution?
options = uc.ChromeOptions()
# options.add_argument('--no-sandbox') # Bypass OS security model
# options.add_argument('--disable-dev-shm-usage') # Overcome limited resource problems
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_argument('--disable-gpu') # Adicione esta linha
#options.add_argument('--headless')
brave_path = r'C:\Users\Teste\hml\selenium\Brave-Browser\Application\brave.exe'
options.binary_location = brave_path
The text was updated successfully, but these errors were encountered: