mintapi / mintapi

an unofficial screen-scraping "API" for Mint.com
MIT License
1.21k stars 275 forks source link

mintapi logon issues - selenium can't find field to navigate authentication sequence #405

Closed assumebreach closed 2 years ago

assumebreach commented 2 years ago

mintapi invocation shows an exception: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="ius-userid"]"}

End of traceback: selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="ius-userid"]"}

What version of MintAPI -> v1.63 installed via pip

Code has been running for a few months without fault. Broke last week. In attempt to fix, I removed the session directory to start from scratch. However, both paths (with mintsession and without) yielded the same error.

Searching through HTML of the mint.com logon sequence, I don't see a ius-userid field. You think they changed the login sequence?

ujjwalkrishna commented 2 years ago

I am also getting the same issue Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="ius-userid"]"} on the login page.

smg247 commented 2 years ago

Same for me. I don't think the issue is a changed element, but it seems that the wrong exception type is being caught in https://github.com/mintapi/mintapi/blob/main/mintapi/signIn.py#L315. It should be a NoSuchElementException.

reokatoa commented 2 years ago

Experiencing the same issue, also with a system that has been running without incident or changes. Watching it operate, I can confirm the user name field does not get populated. Digging into the Mint login flow, it appears the field for the user name is named "ius-identifier".

mintapi version 1.59 Chrome version 98.0.4758.102

zsolteszku commented 2 years ago

Here is a patch that solves the problem: https://github.com/zsolteszku/mintapi/commit/b96562f43f3837bc574ea48ac82d0e02a1221c31

I only published the fix on the new dynamic-mfa-flow branch though, so for that @burkematthew needs to merge the following 2 pull request to arrive to main:

  1. https://github.com/burkematthew/mintapi/pull/6
  2. https://github.com/mintapi/mintapi/pull/392

Or if we are not planning to merge those two soon, someone could apply the patch on main and create a separate PR.

ianvanhoven commented 2 years ago

Patch worked for me (in api.py, not signIn.py); thanks @zsolteszku

burkematthew commented 2 years ago

Hey everyone, thanks for your patience. Looks like some things might have changed on the Mint side. I'll take a look and the referenced PRs and go from there. I'll keep everyone posted!

burkematthew commented 2 years ago

Morning everyone! Just a heads up that I did look at this issue this morning and it seems there are some CSS related changes on the Mint sign in flow, hence the widespread issues reported here. I'm almost to a solution, just working through edge cases. Hopefully I should have this submitted by tomorrow. I'll post here with further updates!

wsilva-1 commented 2 years ago

Looks like the field for user id (formerly "ius-userid") now has an id of "ius-identifier"

dzg commented 2 years ago

It's working, thank you!