Skip to content

Commit

Permalink
Update Selenium Syntax (#201)
Browse files Browse the repository at this point in the history
Replaced outdated Selenium code with newer syntax for compatibility.

Fixes: #86
  • Loading branch information
Ashad001 authored May 9, 2024
1 parent 57be131 commit 57c85d6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions py3pin/Pinterest.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.proxy import Proxy, ProxyType
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By


AGENT_STRING = (
"Mozilla/5.0 (Windows NT 6.1; Win64; x64) "
Expand Down Expand Up @@ -204,10 +206,11 @@ def login(self, headless=True, wait_time=15, proxy=None, lang="en"):
EC.element_to_be_clickable((By.ID, "email"))
)

driver.find_element(By.ID, "email").send_keys(self.email)
driver.find_element(By.ID, "password").send_keys(self.password)
driver.find_element(by = By.ID, value='email').send_keys(self.email)
driver.find_element(by= By.ID, value="password").send_keys(self.password)

logins = driver.find_elements(by=By.XPATH, value="//*[contains(text(), 'Log in')]")

logins = driver.find_elements(By.XPATH, "//*[contains(text(), 'Log in')]")

for login in logins:
login.click()
Expand Down

0 comments on commit 57c85d6

Please sign in to comment.