Try reinstalling .NET framework
https://www.microsoft.com/net/download/dotnet-framework-runtime
https://www.microsoft.com/net/download/dotnet-framework-runtime
from selenium import webdriver
driver = webdriver.Chrome("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
driver.get('file://C://Users//vinit//Downloads//Github//tutorial2//tradingsystem//zerodha_order.html')
driver.implicitly_wait(4)
driver.find_element_by_class_name("button-primary").click()
driver.quit()
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('file:\\C:\\Users\\Shivam\\Trading python\\tutorial-master\\tradingsystem\\zero.html')
driver.implicitly_wait(4)
driver.find_element_by_class_name("button-primary").click()
driver.implicitly_wait(4)
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='uppercase su-input-group']/input").send_keys('USERNAME')
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='su-input-group']/input").send_keys('PASSWORD')
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='actions']/button[@class='button-orange wide']").click()
from selenium import webdriver
driver = webdriver.Firefox(executable_path="C:\\Users\\vinit\\Downloads\\geckodriver-v0.23.0-win64\\geckodriver.exe")
driver.get('file://C://Users//vinit//Downloads//Github//tutorial2//tradingsystem//zerodha_order.html')
driver.implicitly_wait(4)
driver.find_element_by_class_name("button-primary").click()
driver.find_element_by_class_name("button button-blue").click()
driver.quit()
from selenium import webdriver
driver = webdriver.Chrome()
driver.get('file:\\C:\\Users\\Shivam\\Trading python\\tutorial-master\\tradingsystem\\zero.html')
driver.implicitly_wait(4)
driver.find_element_by_class_name("button-primary").click()
driver.implicitly_wait(4)
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='uppercase su-input-group']/input").send_keys('USERNAME')
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='su-input-group']/input").send_keys('PASSWORD')
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='actions']/button[@class='button-orange wide']").click()
from selenium import webdriver
driver = webdriver.Chrome(executable_path="C:\\Users\\vinit\\Downloads\\chromedriver_win32\\chromedriver.exe")
driver.get('file://C://Users//vinit//Downloads//Github//tutorial2//tradingsystem//zerodha_order.html')
driver.implicitly_wait(4)
driver.find_element_by_class_name("button-primary").click()
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='uppercase su-input-group']/input").send_keys('Username')
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='su-input-group']/input").send_keys('Password')
driver.find_element_by_xpath("/html/body[@class='app-view- outer-app-wrapper']/div[@id='outer-app']/div[@class='content']/div[@id='outer-base']/div[@id='container']/div[@class='content']/div[@class='row']/div[@class='login-form']/form/div[@class='actions']/button[@class='button-orange wide']").click()
driver.find_element_by_class_name("button button blue").click()
driver.quit()
def place_order_via_browser(user_id, password, answer):
"""
Login to the browser and place orders
user_id
user id to log in zerodha
password
password for zerodha
answer
answer to 2FA question. Answers should be same for all
the questions zerodha
"""
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.chrome.options import Options
options = Options()
options.add_argument('--headless')
options.add_argument('--disable-gpu')
driver = webdriver.Chrome(chrome_options=options)
driver.get("https://kite.zerodha.com")
login_form = WebDriverWait(driver, 45).until(
EC.presence_of_element_located((By.CLASS_NAME, "login-form")))
login_form.find_elements_by_tag_name('input')[0].send_keys(user_id)
login_form.find_elements_by_tag_name('input')[1].send_keys(password)
WebDriverWait(driver, 45).until(
EC.presence_of_element_located((By.CLASS_NAME, "button-orange")))
driver.find_element_by_xpath('//button[@type="submit"]').click()
twofa_form = WebDriverWait(driver, 45).until(
EC.presence_of_element_located((By.CLASS_NAME, "twofa-form")))
twofa_form.find_elements_by_tag_name('input')[0].send_keys(answer)
twofa_form.find_elements_by_tag_name('input')[1].send_keys(answer)
WebDriverWait(driver, 45).until(
EC.presence_of_element_located((By.CLASS_NAME, "button-orange")))
driver.find_element_by_xpath('//button[@type="submit"]').click()
time.sleep(2)
driver.quit()
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Creating a Trading Journal. | Trading Diary | 6 | ||
S | Need help for creating simple auto algo | Algo & Automated Trading | 1 | |
V | Need Help on Creating Simple AFL Scanner | Algo & Automated Trading | 2 | |
HELP PLEASE FOR CREATING ATR related AFL | AmiBroker | 1 | ||
R | Creating a Strategy for Trading View | Algo & Automated Trading | 0 |