# import traceback from email.mime.text import MIMEText from smtplib import SMTP_SSL from helium import * from funds import Fund class GfFund(Fund): """ 广发基金 """ def __init__(self, url="https://trade.gffunds.com.cn/login", mobile=True, headless=True): super().__init__(url, mobile=mobile, headless=headless) def login(self): write('15359827092', into=S('input#userName')) write('Q6bcV7tvEw4jiZT', into=S('input#password')) click(S('span.ant-checkbox')) click(Text('登 录')) def my_assets(self): asset_el = S('span.text-x3l') if not asset_el.exists: wait_until(asset_el.exists) print("资产总额:") print(f"{asset_el.web_element.text}") with GfFund(headless=False, mobile=False) as fund: fund.login() fund.my_assets()