diff --git a/firstrade/account.py b/firstrade/account.py index ab8cb64..6a38219 100644 --- a/firstrade/account.py +++ b/firstrade/account.py @@ -47,8 +47,8 @@ def login(self): 'redirect': '', 'ft_locale': 'en-us', 'login.x': 'Log In', - 'username': self.username, - 'password': self.password, + 'username': r'' + self.username, + 'password': r'' + self.password, 'destination_page': 'home' } diff --git a/firstrade/symbols.py b/firstrade/symbols.py index 2008f21..07d9576 100644 --- a/firstrade/symbols.py +++ b/firstrade/symbols.py @@ -42,7 +42,11 @@ def __init__(self, ft_session: FTSession, symbol: str): self.ask = float(quote.find('ask').text) self.last = float(quote.find('last').text) self.change = float(quote.find('change').text) - self.high = float(quote.find('high').text) - self.low = float(quote.find('low').text) + if quote.find('high').text == 'N/A': + self.high = None + else: + self.high = float(quote.find('high').text) + if quote.find('low').text == 'N/A': + self.low = None self.volume = quote.find('vol').text self.company_name = quote.find('companyname').text diff --git a/setup.py b/setup.py index c631f38..72fe639 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="firstrade", - version="0.0.6", + version="0.0.7", author="MaxxRK", author_email="maxxrk@pm.me", description="An unofficial API for Firstrade", @@ -13,7 +13,7 @@ long_description_content_type="text/markdown", license="MIT", url='https://github.com/MaxxRK/firstrade-api', - download_url='https://github.com/MaxxRK/firstrade-api/archive/refs/tags/006.tar.gz', + download_url='https://github.com/MaxxRK/firstrade-api/archive/refs/tags/007.tar.gz', keywords=['FIRSTRADE', 'API'], install_requires=['requests', 'beautifulsoup4', 'lxml'], packages=['firstrade'],