This repository has been archived by the owner on Aug 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathmain.py
97 lines (74 loc) · 4.19 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
from time import sleep
from utils.func import *
from utils.file_reader import file_reader
from utils.input_parser import input_parser
input_file = file_reader('demats.txt')
# Gets the value from the lines of the input file
demats = input_parser(input_file)
# Description Banner for the tool
print ("""
-----------------------------------------------------------------------------------------
█████╗ ██╗ ██╗████████╗ ██████╗ ██╗██████╗ ██████╗ ██████╗ ██████╗ ████████╗
██╔══██╗██║ ██║╚══██╔══╝██╔═══██╗ ██║██╔══██╗██╔═══██╗ ██╔══██╗██╔═══██╗╚══██╔══╝
███████║██║ ██║ ██║ ██║ ██║ ██║██████╔╝██║ ██║ ██████╔╝██║ ██║ ██║
██╔══██║██║ ██║ ██║ ██║ ██║ ██║██╔═══╝ ██║ ██║ ██╔══██╗██║ ██║ ██║
██║ ██║╚██████╔╝ ██║ ╚██████╔╝ ██║██║ ╚██████╔╝ ██████╔╝╚██████╔╝ ██║
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝
-----------------------------------------------------------------------------------------
Author: Bipin Thapa
Github repository: https://github.com/bipin0x01/meroshare-bot
Twitter: @kaji0x01
Facebook: https://www.facebook.com/bt.kaji
-----------------------------------------------------------------------------------------
""")
# List all open IPOS in a table using the first account given by user
try:
number_of_accounts = len(demats)
print(f'Number of accounts Detected: {number_of_accounts}')
for account in demats:
name, dp_id, username, password, crn, txn_pin = [account[i] for i in range(6)]
try:
while web_driver.driver.current_url != "https://meroshare.cdsc.com.np/#/dashboard":
login(dp_id,username,password)
sleep(2)
if web_driver.driver.current_url == "https://meroshare.cdsc.com.np/#/dashboard":
break
except:
print('Could not login! Please try again')
break
goto_asba()
open_ipo_lister()
break
except Exception as e:
print(e)
quit_browser()
share = int(input('Press Enter the respective option to continue:'))
number_kitta = int(input('Press Enter the number of units(kitta) to be applied.'))
try:
for account in demats: # Loops through each account in the input file
name, dp_id, username, password, crn, txn_pin = [account[i] for i in range(6)] # Gets the user creds from the account data
try:
while web_driver.driver.current_url != "https://meroshare.cdsc.com.np/#/dashboard":
login(dp_id,username,password)
sleep(2)
if web_driver.driver.current_url == "https://meroshare.cdsc.com.np/#/dashboard":
break
except Exception as e:
print('Could not login. Please check the login credentials and try again.')
break
print("Applying {} kitta IPO with {}'s account".format(number_kitta,name))
goto_asba()
sleep(1)
try:
# select the ipo chosen from the list by the user
ipo_selector(share)
except Exception as e:
termcolor.cprint('Looks like you have already applied for this IPO from {}\'s account'.format(name), 'red')
continue
sleep(1)
apply_ipo(number_kitta,crn,txn_pin)
sleep(1)
quit_browser()
except Exception as e:
print(e)
quit_browser()