Skip to content
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

Can't scrape more than one year's worth of data #894

Open
whatuserever opened this issue Jan 19, 2025 · 2 comments
Open

Can't scrape more than one year's worth of data #894

whatuserever opened this issue Jan 19, 2025 · 2 comments

Comments

@whatuserever
Copy link
Contributor

whatuserever commented Jan 19, 2025

I'm trying to scrape all available data from my financial accounts. However, when I set a start date for more than one year ago, it gets overwritten with a date that is about one year ago from today.

Looking at the code, this seems to be the root cause:

const defaultStartMoment = moment().subtract(1, 'years').add(1, 'day');
const startDate = this.options.startDate || defaultStartMoment.toDate();
const startMoment = moment.max(defaultStartMoment, moment(startDate));

I noticed that this logic exists in most (all?) scrapers.

Testing Beinleumi and Max without this, i.e. with the following diff, seems to work perfectly fine:

-    const startMoment = moment.max(defaultStartMoment, moment(startDate));
+    const startMoment = moment(startDate);

Is there a reason for this limitation? Can it be removed?

@baruchiro
Copy link
Collaborator

I think it should be defined like this only for websites that disallow fetching more than one year before.

@whatuserever
Copy link
Contributor Author

I figured the history limit for Beinleumi and Max and created PRs. Hopefully others can do the same for the rest :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants