-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding mercantile bank scraper #838
Conversation
Welcome @EzzatQ !! I hope I will review it soon :-) |
Thanks @baruchiro. Thanks for this repo, didn't expect to find something like this but was pleasantly surprised. I continued testing this PR and it looks like for mercantile we can only extract up to one year of transactions from current day (or actually 364 days to be exact), if requesting a longer period, mercantile's api will return an error message saying that "the requested information is not available, if you need more assistance call us on ....". I'm wondering whether I should add some validation to the |
@EzzatQ see the Discount bank as an example of limiting the israeli-bank-scrapers/src/scrapers/discount.ts Lines 78 to 80 in 74479a1
|
I am aware of the defaultStartMoment solution, in fact it is implemented in the mercantile scraper because it extends the discount scraper class. What I am talking about is validation of the user input, because if I supply a date that is before 1 year prior, I get an error from mercantile api, and that error is not propagated to the user. Even if it was, the error tells me nothing about why that issue happened aka the user won't know that the scraper is failing because of an invalid start date. I personally have no problem to be added as a Code Owner. I don't know about @kfirarad as his PR is 3 years old |
Correct me if I'm wrong, but if you use the max date between the user |
Yes exactly |
Hi! |
@EzzatQ So I don't understand when you will get the error, there will be no case for retrieving more than one year ago. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved!
I see it is the same scraper like DiscountScraper. If it is working for you, I accept it.
package-lock.json
Outdated
@@ -1,14130 +1,8 @@ | |||
{ | |||
"name": "israeli-bank-scrapers", | |||
"version": "1.0.4", | |||
"lockfileVersion": 2, | |||
"lockfileVersion": 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you didn't changed the package.json
the package.lock.json
should not be changed too.
I guess it is because you're using the wrong version of NodeJS, which needs to be v16.19.0
.
import DiscountScraper from './discount'; | ||
|
||
type ScraperSpecificCredentials = { id: string, password: string, num: string }; | ||
class MercantileScraper extends DiscountScraper { | ||
getLoginOptions(credentials: ScraperSpecificCredentials) { | ||
return { | ||
...super.getLoginOptions(credentials), | ||
loginUrl: 'https://start.telebank.co.il/login/?bank=m', | ||
}; | ||
} | ||
} | ||
|
||
export default MercantileScraper; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG I postponed this review for long time, just to finally review it and see it based on another scraper??
Sorry!!
🎉 This PR is included in version 4.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Sorry for disappearing, got very busy. |
Changes:
Created a new scraper for bank Mercantile based on the Discount bank. The implementations are identical as both mercantile and discount use the same system. The only difference between the two is the login url (
https://start.telebank.co.il/login/?bank=m
). Code is based on pull request by @kfirarad.I have a mercantile account and I was able to test the scrapper successfully. Manually inspecting the payload returned by
scraper.scrape
: