-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fail to login due to language of web driver does not change #193
Comments
This is due to the changing of the language of the driver is not working py3-pinterest/py3pin/Pinterest.py Line 187 in 8a01d43
Adding this line |
Anyway, I recommend use the english language. Otherwise logins may not be found py3-pinterest/py3pin/Pinterest.py Line 212 in 8a01d43
due to the text to search may be different |
Running into the same issue I can confirm that changing the profile settings on Pinterest to country: US and language English solves this problem but will of course change your user experience in Pinterest to English. Hence I tried something different and change the login function in Pinterest.py to: ...
driver = webdriver.Chrome(options=chrome_options)
# select login url according to lang parameter
login_url = "https://pinterest.com/login"
if lang == "de":
login_url = "https://pinterest.de/login"
driver.get(login_url)
try:
WebDriverWait(driver, wait_time).until(
EC.element_to_be_clickable((By.ID, "email"))
)
driver.find_element(by = By.ID, value='email').send_keys(self.email)
driver.find_element(by = By.ID, value="password").send_keys(self.password)
driver.find_element(by = By.ID, value="password").send_keys(Keys.ENTER)
WebDriverWait(driver, wait_time).until(
EC.invisibility_of_element((By.ID, "email"))
)
cookies = driver.get_cookies()
... It is important to use the language specific login page, seems Pinterest does some magic in conjunction with the language setting in the profile. To be more independent from language specific web page content, instead of searching the element to click on the web-page, you can just send a key press for the return key. This solution works for me using English or German and probably will work for other languages too, if you extend the if-clause determin the login_url. |
I specify the language when login:
pinterest.login(lang="en")
. But when driver goes to "https://pinterest.com/login"py3-pinterest/py3pin/Pinterest.py
Line 202 in 8a01d43
Then the login fails at looking for logins
py3-pinterest/py3pin/Pinterest.py
Line 212 in 8a01d43
The text was updated successfully, but these errors were encountered: