-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
53 lines (47 loc) · 3.59 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
import time
from playwright.sync_api import sync_playwright
import neotermcolor
from bot.func import login,gotoAsba,ipo_selector,apply_share
with sync_playwright() as p:
# Description Banner for the tool
print("""
-----------------------------------------------------------------------------------------
███╗ ███╗███████╗██████╗ ██████╗ ███████╗██╗ ██╗ █████╗ ██████╗ ███████╗ ██████╗ ██████╗ ████████╗
████╗ ████║██╔════╝██╔══██╗██╔═══██╗██╔════╝██║ ██║██╔══██╗██╔══██╗██╔════╝ ██╔══██╗██╔═══██╗╚══██╔══╝
██╔████╔██║█████╗ ██████╔╝██║ ██║███████╗███████║███████║██████╔╝█████╗ ██████╔╝██║ ██║ ██║
██║╚██╔╝██║██╔══╝ ██╔══██╗██║ ██║╚════██║██╔══██║██╔══██║██╔══██╗██╔══╝ ██╔══██╗██║ ██║ ██║
██║ ╚═╝ ██║███████╗██║ ██║╚██████╔╝███████║██║ ██║██║ ██║██║ ██║███████╗ ██████╔╝╚██████╔╝ ██║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚═╝
-----------------------------------------------------------------------------------------
Author: Kishmat Bhattarai
Github repository: https://github.com/tprototype/meroshare-bot
Twitter: @tprototypex
-----------------------------------------------------------------------------------------
""")
browser = p.chromium.launch(headless=True)
page = browser.new_page(user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36')
page.goto("https://meroshare.cdsc.com.np")
time.sleep(5)
total = []
with open("demats.txt", 'r') as f:
for x in f.readlines():
x = x[0:-1]
total.append(x.split(","))
for account in total:
name, dp_id, username, password, bank, kitta, crn, txn_pin = account
print('Working for ' + name + ' :')
login(page,dp_id,username,password)
time.sleep(2)
try:
total = gotoAsba(page)
except:
neotermcolor.cprint(f"Login Error, recheck credentials of {name}","red")
neotermcolor.cprint("-------------------------------------------","red")
continue
position = int(input("Enter the OPTION NUMBER you want to apply IPO for : "))
ipo_selector(page,total,position)
time.sleep(2)
apply_share(page,bank,kitta,crn,txn_pin)
time.sleep(5)
neotermcolor.cprint("-------------------------------------------","green")
browser.close()