Creating a trading system from scratch

How many lines of code you are comfortable with


  • Total voters
    61
Place place_order_via_browser outside the code.
It is a function
Say, your id is XXXXXX, password = password, 2fa password - 2FA
Now, run
Python:
place_order_via_browser('XXXXXX', 'password', '2FA')
No need to modify the function except for selecting the browser/driver
I have still been getting this error
 

Attachments

Last edited:
I have still been getting this error
Master's code is working exceptionally fine i like webdriver wait command

if are not able to figure out whats wrong use this thing which you can easily digest implement webriver wait yourself so in future when next page does not load it doesnt throw error

Code:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

options = Options()
options.add_argument('--disable-gpu')
#options.add_argument('-headless')
driver = webdriver.Chrome(options=options)
driver.get('file:\\C:\\Users\\Trading python\\tutorial-master\\tradingsystem\\zerodha_order.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.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='actions']/button[@class='button-orange wide']").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[@class='twofa-form form']/div[2]/div[@class='su-input-group su-static-label']/input").send_keys('2fa')
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[@class='twofa-form form']/div[3]/div[@class='su-input-group su-static-label']/input").send_keys('2fa')
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[@class='twofa-form form']/div[@class='actions']/button[@class='button-orange wide']").click()
driver.find_element_by_class_name("button-blue").click()
 
Last edited:

Similar threads