0

I am currently trying to download this file using webKitview on swift, then save it to the bundle resources.

I tried to use an evaluateJavascript function, but did not work.

Is there some method on how to do this?

The link i am currently trying to do is:

https://blockchain.info/export-history?active=13gWtMQJdg3H6XBpFjMELcHLJc1HHp79vD

I was trying to programtically click the export button, then download file as csv

Thank you for any help you can provide

WeCanBeFriends
  • 641
  • 1
  • 10
  • 23

2 Answers2

0

It's very like that this export button triggers a GET request to another URL providing those parameters (dates, export type and address).

I'd use Chrome's inspection (or Firefox's) and monitor the network to see what happens when you click on the export button.

Then I'd mimic the same request from iOS using Alamofire, or NSRequest.

Rafael Guerreiro
  • 196
  • 3
  • 14
  • I tried that however, there was information in the network console. Have you tried it? – WeCanBeFriends Jan 17 '18 at 00:07
  • That's probably because it caused a redirect. You can preserve logs, like described here: https://stackoverflow.com/questions/10703944/google-developer-tools-network-tab-clears-after-redirect – Rafael Guerreiro Jan 17 '18 at 02:23
0

Using mitmproxy. I intercepted the network requests and found out that it was a post request.

I will take raphael's answer and say that we can use Alamofire to simulate this same post request and get the data we need.

WeCanBeFriends
  • 641
  • 1
  • 10
  • 23