Can't find a way to create a new note using Selenium for Python in a headless enviroment.
These are my entire tries (none of these methods worked in a headless enviroment). Is there a solution? Thank you.
try:
wd.find_element_by_xpath('//*[@id="qa-CREATE_NOTE"]').click()
sleep(1)
wd.find_element_by_xpath('//*[@id="ActionMenu"]/ul[1]/li[1]/button').click()
print("criou nova nota")
except:
try:
wd.find_element_by_xpath('//*[@id="qa-CREATE_NOTE"]/path').click()
sleep(1)
wd.find_element_by_xpath('//*[@id="ActionMenu"]/ul[1]/li[1]/button/svg/path[1]').click()
except:
try:
wd.find_element_by_xpath('//*[@id="qa-NOTELIST_SUBHEADER_ACTIONS"]').click()
except:
try:
wd.find_element_by_id('qa-NOTELIST_SUBHEADER_ACTIONS').click()
print("achei o menu pelo ID")
sleep(0.5)
except:
try:
wd.find_element_by_class_name('_2hOozI1nBOe0Iwq14eLL-O').click()
sleep(0.5)
wd.find_element_by_class_name('oA-DV8tcbOZMAioJiHwK4').click()
except:
try:
wd.find_elements_by_class_name('Button')[1].click()
sleep(0.2)
wd.find_element_by_link_text('Nota').click()
except:
try:
wd.find_element_by_xpath('//*[@id="qa-ACTION_ADD_NEW_NOTE"]/div/span/span').click()
except:
wd.find_element_by_id('qa-ACTION_ADD_NEW_NOTE').click()