Skip to content
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

"Yahoo Finance Premium instituting recaptcha #254" #255

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions yahooquery/headless.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,17 @@
try:
self.driver.execute_script("window.open('{}');".format(self.LOGIN_URL))
self.driver.switch_to.window(self.driver.window_handles[-1])
self.driver.find_element(By.ID, "login-username").send_keys(self.username)
#self.driver.find_element(By.ID, "login-username").send_keys(self.username)
self.driver.find_element(By.XPATH, "//input[@id='login-username']").send_keys(self.username)

Check warning on line 43 in yahooquery/headless.py

View check run for this annotation

Codecov / codecov/patch

yahooquery/headless.py#L42-L43

Added lines #L42 - L43 were not covered by tests
self.driver.find_element(By.XPATH, "//input[@id='login-signin']").click()
password_element = WebDriverWait(self.driver, 10).until(
EC.presence_of_element_located((By.ID, "login-passwd"))
)
password_element.send_keys(self.password)
self.driver.find_element(By.XPATH, "//button[@id='login-signin']").click()
cookies = self.driver.get_cookies()
self.cookies = self.driver.get_cookies()

Check warning on line 50 in yahooquery/headless.py

View check run for this annotation

Codecov / codecov/patch

yahooquery/headless.py#L50

Added line #L50 was not covered by tests
self.driver.quit()
self._add_cookies_to_jar(cookies)
self._add_cookies_to_jar(self.cookies)

except TimeoutException:
return (
Expand Down
Loading