This Codes works perfectly on my own pc - but when i upload it here it does not. At the last browser.get i have printed the html to make sure it ends on the right site. I get no error message and it finds the right elements. On my own pc i use firefox driver. Could this be the issue? i Dont know how to debug to find out where the issue lies.
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from time import sleep
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless")
chrome_options.add_argument("--disable-gpu")
browser = webdriver.Chrome(options=chrome_options)
try:
browser.get('https://app.powerbi.com/?noSignUpCheck=1')
email = browser.find_element_by_xpath('//*[@id="i0116"]')
email.send_keys('USERNAME')
submit = browser.find_element_by_id('idSIButton9')
submit.click()
sleep(3)
password = browser.find_element_by_id('i0118')
password.send_keys('PASSWORD')
submit = browser.find_element_by_id('idSIButton9')
submit.click()
sleep(3)
no = browser.find_element_by_id('idBtn_Back')
no.click()
sleep(2)
browser.get('https://app.powerbi.com/groups/fd78c947-2a4b-4ce1-ae19-3699b4862f35')
sleep(3)
dataset = browser.find_elements_by_xpath('//*[@title="Production Dashboard"]')
sleep(1)
refresh = browser.find_elements_by_xpath('//*[@title="Refresh now"]')
sleep(1)
ActionChains(browser).move_to_element(dataset[1]).perform()
sleep(1)
refresh[0].click()
finally:
browser.quit()