views:

287

answers:

1

I have been playing around with NSURLConnection.

Now I'm trying to grab some data from a webpage, but first I need to insert my username and password on the website, in order to get the data.

I want to know:

  1. How to insert a value into a textfield on the webpage
  2. How to press the log in button, once I have supplied the username and password

Similar Apps such as "iiQouta" are able to retrieve data by using your username and password.

I'm not sure how they did it, can anyone explain how this kind of application works?

+1  A: 

I don't think you can do that this way. What you probably want to do is to create a POST request that will have username and password filled in with the values of yours and send that to the server. This will be exactly as filling the data manually and sending it by clicking submit button (in most cases at least).

The easiest way to do that is to use some kind of software that allows you to see the requests you are sending (Ethereal should do the trick, Firebug can help you as well), manually log in to that site and check what data is in the request. Then just create similar request in your app and send it. However it this is done over SSL (and it really should be) the data will be encrypted so you have to analyze the login form yourself and figure out how to manually create correct POST request.

RaYell