示例#1
0
def login(creds: Credentials,
          driver: webdriver.remote.webdriver.WebDriver) -> None:
    logging.info("Logging in.")
    LOGIN_PAGE = 'https://trader.degiro.nl/login/chde/#/login'
    driver.get(LOGIN_PAGE)
    driver.find_element(By.ID, "username").send_keys(creds.id + Keys.TAB)
    driver.find_element(By.ID, "password").send_keys(creds.pwd + Keys.RETURN)
示例#2
0
def login(creds: Credentials,
          driver: webdriver.remote.webdriver.WebDriver) -> None:
    LOGIN_PAGE = 'https://www.bcge.ch/authen/login?lang=de'
    driver.get(LOGIN_PAGE)
    wait = WebDriverWait(driver, 30)
    wait.until(
        expected_conditions.presence_of_element_located((By.ID, 'username')))
    driver.find_element(By.ID, "username").send_keys(creds.id + Keys.TAB)
    driver.find_element(By.ID, "password").send_keys(creds.pwd + Keys.RETURN)
示例#3
0
def login_to_mbank(creds: Credentials,
                   driver: webdriver.remote.webdriver.WebDriver) -> None:
    driver.get(MBANK_LOGIN_PAGE)
    driver.find_element(By.ID, "userID").send_keys(creds.id + Keys.TAB)
    driver.find_element(By.ID, "pass").send_keys(creds.pwd + Keys.RETURN)
    wait = WebDriverWait(driver, 30)
    wait.until(
        expected_conditions.element_to_be_clickable(
            (By.CSS_SELECTOR,
             '[data-test-id="SCA:UnknownDevice:OneTimeAccess"]'))).click()
    wait = WebDriverWait(driver, 30)
    wait.until(expected_conditions.url_matches(HISTORY_PAGE))
示例#4
0
def login(creds: Credentials,
          driver: webdriver.remote.webdriver.WebDriver) -> None:
    """Logs into the Charles Schwab website"""
    LOGIN_PAGE = 'https://client.schwab.com/Login/SignOn/CustomerCenterLogin.aspx'
    driver.get(LOGIN_PAGE)
    driver.switch_to.frame("lmsSecondaryLogin")
    login_id = driver.find_element(By.ID, "loginIdInput")
    wait = WebDriverWait(driver, 30)
    wait.until(expected_conditions.visibility_of(login_id))
    login_id.send_keys(creds.id + Keys.TAB)
    driver.find_element(By.ID,
                        "passwordInput").send_keys(creds.pwd + Keys.RETURN)
    wait_for_pin_number_and_select_it(wait, driver)
    wait_for_user_to_provide_pin_and_login(driver)
示例#5
0
def login(creds: Credentials,
          driver: webdriver.remote.webdriver.WebDriver) -> None:
    username_field_name = 'Benutzername'
    driver.get(LOGIN_PAGE)
    wait = WebDriverWait(driver, 30)
    wait.until(
        expected_conditions.presence_of_element_located(
            (By.ID, username_field_name)))
    driver.find_element(By.ID,
                        username_field_name).send_keys(creds.id + Keys.TAB)
    time.sleep(1)
    pwd_field = driver.find_element(By.ID, "Passwort")
    pwd_field.send_keys(creds.pwd)
    time.sleep(1)
    pwd_field.send_keys(Keys.RETURN)
示例#6
0
def fetch_portfolio(driver: webdriver.remote.webdriver.WebDriver) -> bytes:
    logging.info("Fetching portfolio.")
    portfolioSideBarLink = driver.find_element(By.CSS_SELECTOR,
                                               '[href="#/portfolio"]')
    portfolioSideBarLink.click()
    exportButton = driver.find_element(By.CSS_SELECTOR,
                                       '[data-name="exportButton"]')
    exportButton.click()
    time.sleep(1)
    reportExportForm = driver.find_element(By.CSS_SELECTOR,
                                           '[data-name="reportExportForm"]')
    csvLink = reportExportForm.find_element(
        By.XPATH, "//a[normalize-space(text()) = 'CSV']")
    csvFetchUrl = csvLink.get_attribute('href')
    cookies = driver_cookie_jar_to_requests_cookies(driver.get_cookies())
    return fetch_csv(csvFetchUrl, cookies)
示例#7
0
def fetch_latest_bill(driver: webdriver.remote.webdriver.WebDriver) -> bytes:
    driver.get('https://one.viseca.ch/de/rechnungen')
    driver.implicitly_wait(30)
    latest_bill_a_elem = driver.find_element(
        By.CSS_SELECTOR, '#statement-list-statement-date0 a')
    latest_bill_id = extract_bid(latest_bill_a_elem.get_attribute('id'))
    return fetch_bill(latest_bill_id, driver.get_cookies())
示例#8
0
def fetch_account(driver: webdriver.remote.webdriver.WebDriver) -> bytes:
    logging.info("Fetching account.")
    driver.get(
        get_account_overview_url(
            from_date=get_three_months_ago(date.today()),
            to_date=date.today(),
        ))
    exportButton = driver.find_element(By.CSS_SELECTOR,
                                       '[data-name="exportButton"]')
    exportButton.click()
    time.sleep(1)
    reportExportForm = driver.find_element(By.CSS_SELECTOR,
                                           '[data-name="reportExportForm"]')
    csvLink = reportExportForm.find_element(
        By.XPATH, "//a[normalize-space(text()) = 'CSV']")
    csvFetchUrl = csvLink.get_attribute('href')
    cookies = driver_cookie_jar_to_requests_cookies(driver.get_cookies())
    return fetch_csv(csvFetchUrl, cookies)
示例#9
0
def wait_for_pin_number_and_select_it(
        wait: WebDriverWait, driver: webdriver.remote.webdriver.WebDriver):
    wait.until(
        expected_conditions.url_matches('https://sws-gateway.schwab.com/.*'))
    driver.switch_to.window(driver.window_handles[0])
    pin_element = driver.find_element(By.ID, "placeholderCode")
    # Initially the element is findable but not clickable. When that happens,
    # the click operation fails, so wait for the element to be visible.
    wait.until(expected_conditions.visibility_of(pin_element))
    pin_element.click()
    return pin_element
示例#10
0
def login(creds: Credentials,
          driver: webdriver.remote.webdriver.WebDriver) -> None:
    driver.implicitly_wait(10)
    LOGIN_PAGE = 'https://app.revolut.com/start'
    driver.get(LOGIN_PAGE)
    form = driver.find_element(By.CSS_SELECTOR, 'form')
    country_code_input, phone_number_input = form.find_elements(
        By.CSS_SELECTOR, 'input')
    set_value(driver, country_code_input, creds.country_code)
    phone_number_input.send_keys(creds.phone_number + Keys.RETURN)

    fields = find_pin_input_fields(driver)
    fields[0].send_keys(creds.pin)
示例#11
0
def login(creds: Credentials,
          driver: webdriver.remote.webdriver.WebDriver) -> None:
    LOGIN_PAGE = 'https://app.finpension.ch/login'
    driver.get(LOGIN_PAGE)
    phone_country_selection = driver.find_element(By.CSS_SELECTOR,
                                                  ".PhoneInputCountrySelect")
    set_value(driver, phone_country_selection, 'CH')
    wait = WebDriverWait(driver, 30)
    mobile_number_field = wait.until(
        expected_conditions.element_to_be_clickable((By.ID, 'mobile_number')))
    password_field = wait.until(
        expected_conditions.element_to_be_clickable((By.NAME, 'password')))
    mobile_number_field.send_keys(creds.id + Keys.TAB)
    password_field.send_keys(creds.pwd + Keys.RETURN)
    code_field = wait.until(
        expected_conditions.element_to_be_clickable(
            (By.CSS_SELECTOR, 'ion-input[name=code]')))
    code_field.click()
示例#12
0
def login(creds: Credentials,
          driver: webdriver.remote.webdriver.WebDriver) -> None:
    LOGIN_PAGE = 'https://www.interactivebrokers.co.uk/sso/Login?RL=1'
    driver.get(LOGIN_PAGE)
    driver.find_element(By.ID, "user_name").send_keys(creds.id + Keys.TAB)
    driver.find_element(By.ID, "password").send_keys(creds.pwd + Keys.RETURN)