-1

I tagged this question as "conceptual" because I'm not sure if creating Chrome Extension is the best way. In my opinion it's better to ask before spending few hours writing something and find out that some part is too much difficult or impossible.

The problem I used to analyze my finance using csv files downloaded from bank account. But as it sometimes happens, my bank launched new GUI and csv feature disappeared. They do not know when and whether they will do it at all. So I have to grab transactions in some way and put them in CSV file.

Concept of solution I think scrapping the page with transactions it's not good way, because whole data is looking like generated with totally random CSS classes and ids. I noticed that list of transactions is sent in JSON format by AJAX response. I analyzed that JSON and every interested field has name, so access to data is quite easy. Only one problem I see, it's that first JSON load shows only first 10 transactions. To load more I have to scroll down, then there is next AJAX request to the same URI, then next JSON load comes in response. So, if I want to get transactions from whole month I have to scroll few times down and my tool should catch first and also next responses. I don't have experience with Chrome Extensions but they claim that if I know web technologies like JS, CSS, HTML it shouldn't be difficult to write simple extension. If I can take this JSON from AJAX response to my extension then generating CSV file shouldn't be problem.

The question The main question is if my concept is possible to realize. Is there easy access to data loaded from AJAX response? If you see any better solution I'm open to suggestions.

Lukaszy
  • 191
  • 17
  • 1
    I'm guessing the access to next 10 transactions is probably easier to get fully with javascript rather than scrolling every time. If the request is to the same URI but you get the next 10 transactions there is probably something else also being sent to the server which gives these instructions. Possibly there is even a way to request a specific number of transactions, but anyway, it shouldn't be hard to get as much as you want once you just examine the requests being sent and then replicating them in a Chrome extension. – Luka Čelebić Jan 08 '18 at 23:21
  • Good point. But I don't know how many transactions I need. It's not about amount but about date. I need transactions about actual month. So I can get first 10, check last on if still has searched month. If yes I can take next 10 and check. And the same until I get transactions from month which is not interesting for me. I will present here my results. – Lukaszy Jan 11 '18 at 10:32

1 Answers1

1

you can create CSV file from Json in DOM (don't required to call any API).

Please refer this demo link

jsfiddle.net/hybrid13i/JXrwM/

if you care implemented this functionality in chrome extinction so you need to add download permission in manifist.json https://developer.chrome.com/extensions/downloads

Pankaj Rupapara
  • 752
  • 4
  • 9