34 lines
866 B
Python
34 lines
866 B
Python
# import traceback
|
|
from email.mime.text import MIMEText
|
|
from smtplib import SMTP_SSL
|
|
|
|
from helium import *
|
|
|
|
from funds import Fund
|
|
|
|
|
|
class EFund(Fund):
|
|
"""
|
|
易方达基金
|
|
"""
|
|
def __init__(self, url="https://e.efunds.com.cn/", mobile=True, headless=True):
|
|
super().__init__(url, mobile=mobile, headless=headless)
|
|
|
|
|
|
def login(self):
|
|
write('15359827092', into=S('input#certID'))
|
|
write('DJUWwiN4ep9XzsN', into=S('input#tradepassword'))
|
|
click(S('div#agreementRadioBox'))
|
|
click(S('input#submitBtn'))
|
|
|
|
def my_assets(self):
|
|
asset_el = S('td.f-tl.fis-col')
|
|
if not asset_el.exists:
|
|
wait_until(asset_el.exists)
|
|
print(f"{asset_el.web_element.text}")
|
|
print("资产总额:")
|
|
|
|
|
|
with EFund(headless=False, mobile=False) as fund:
|
|
fund.login()
|
|
fund.my_assets() |