ログイン処理
def login(driver: webdriver.Chrome, username: str, password: str) -> bool:
"""
認証情報を元にログインを実行する。
以下の情報を返す。
- 成功: True
- 失敗: False
"""
wait = WebDriverWait(driver=driver, timeout=30)
driver.get('URL')
wait.until(EC.presence_of_all_elements_located)
id_form = driver.find_element_by_name('user')
id_form.send_keys(username)
pw_form = driver.find_element_by_name('password')
pw_form.send_keys(password)
pw_form.send_keys(Keys.RETURN)
wait.until(EC.presence_of_all_elements_located)
success_url = 'URL'
if driver.current_url == success_url:
return True
else:
return False