This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#input username | |
user = driver.find_element_by_xpath("//input[@type = 'text']") | |
user.send_keys(username) | |
#input password | |
pwd = driver.find_element_by_xpath("//input[@type = 'password']") | |
pwd.send_keys(password) | |
#click on login | |
driver.find_element_by_xpath("//button[@type='submit']").click() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
from yaml.loader import SafeLoaderwith | |
open('file.yaml') as f: | |
login = yaml.load(f, Loader=SafeLoader) | |
username = login['user_id'] | |
password = login['password'] | |
totp = login['totp'] | |
webdriver_path = login['webdriver_path'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
with open(*your file path*,'r') as f: | |
login = json.load(f) | |
username = login['user_id'] | |
password = login['password'] | |
totp = login['totp'] | |
webdriver_path = login['webdriver_path'] #path of your chromedriver | |
url = login['url'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# launch chrome and open zerodha website | |
from selenium import webdriver | |
from time import sleep | |
from pyotp import TOTP | |
service = webdriver.chrome.service.Service(f'{webdriver_path}/chromedriver.exe') | |
service.start() | |
options = webdriver.ChromeOptions() |
NewerOlder