Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def connect(credentials, scraper_args=None):
import mintapi
mint = mintapi.Mint()
scraper_args = dict(scraper_args or {})
def try_login(scraper):
scraper = MintTokenScraper(credentials=credentials, **scraper_args)
scraper.login()
mint.driver = scraper.driver
mint.token = mint.get_token()
with scrape_lib.temp_scraper(MintTokenScraper, credentials=credentials,
**scraper_args) as scraper:
okay = False
try:
try_login(scraper)
okay = True
except (TimeoutError, selenium.common.exceptions.TimeoutException):
if not scraper_args.get('headless') and not scraper_args.get(
def __init__(self, email=None, password=None, dbname=None, types=None):
self.mint = mintapi.Mint(email, password,
headless=True,
mfa_method = "sms",
wait_for_sync=False,
session_path=os.path.join(os.path.expanduser("~"), '.mintapi', 'session'),
)
self.dbname = dbname
self.types = types
import json
import time
import mintapi
from lxml import html
MINT_OVERVIEW_URL = 'https://mint.intuit.com/overview.event'
PROPERTY_URL_FORMAT = 'https://mint.intuit.com/mas/v1/providers/PFM:{}_{}/accounts/PFM:OtherPropertyAccount:{}_{}'
class Mint(mintapi.Mint):
browser_auth_api_key = None
mint_user_id = None
def login_and_get_token(self, email, password):
super(Mint, self).login_and_get_token(email, password)
doc = html.document_fromstring(self.get(MINT_OVERVIEW_URL).text)
self.mint_user_id = json.loads(doc.get_element_by_id('javascript-user').value)['userId']
self.browser_auth_api_key = self.driver.execute_script('return window.MintConfig.browserAuthAPIKey')
def patch(self, url, **kwargs):
self.driver.request('PATCH', url, **kwargs)
def set_property_account_value(self, account, value):
account_id = account['accountId']
account_login_id = account['fiLoginId']