dimanche 15 juillet 2018

Selenium: cant get the correct coordinates of element with Python

url = 'https://golestan.kntu.ac.ir/home/balancer/balancer.aspx?vv=2&cost=main'
driver = webdriver.Chrome(executable_path = "G://captcha recognition project//chromedriver.exe")
driver.get(url)
driver.set_window_size(1920, 1080)
element = driver.find_element_by_xpath('//*[@id="tblCap"]/tbody/tr[1]/td[3]/img')
location = element.location
size = element.size

return the size correctly but coordinates are not exact for example the correct coordinates are 1100 & 600 but the output is 900 & 500 any solution?????




Aucun commentaire:

Enregistrer un commentaire