I am pretty stuck with the following problem. This is a simple script which updates CV on the website.
#!/usr/bin/env python3
from selenium import webdriver
# Authentication details
LOGIN = input("Please type your email ---> ")
PASSWORD = input("Please type your password ---> ")
# Chrome is a default browser, change to appropriated one
browser = webdriver.Chrome()
browser.get('https://www.hh.ru/account/login')
# Authentication
emailel = browser.find_element_by_css_selector('input[type="email"]')
emailel.send_keys(LOGIN)
passel = browser.find_element_by_css_selector('input[type="password"]')
passel.send_keys(PASSWORD)
passel.submit()
# Looking for CV's links
browser.get('https://hh.ru/applicant/resumes')
links = []
resume_els = browser.find_elements_by_css_selector('a.b-resumelist-vacancyname')
for r in resume_els:
links.append(r.get_attribute('href'))
# Update all CVs
for link in links:
browser.get(link)
refresh_button = browser.find_element_by_css_selector('button.HH-Resume-Touch-Button')
refresh_button.click()
# Quit webdriver
browser.quit()
This code works perfectly on my PC but when I run it on my laptop the error "element not visible" appears:
Traceback (most recent call last):
File "C:/Python36/test.py", line 36, in <module>
refresh_button.click()
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 77, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 494, in _execute
return self._parent.execute(command, params)
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "C:\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
(Session info: chrome=55.0.2883.87)
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 6.3.9600 x86_64)
I use the same version of chrome, chromedriver, python and selenium on my computers. Windows are different (it's 7 on my PC and 8 on my laptop). Any ideas why this code does not work on my laptop? I tried to use explicit and implicit wait, but element is still invisible.