How to programmatically fill in web forms to get past authentication pages? (in iOS)
How can I programmatically fill in web forms to get past authentication pages in iOS?
Basically, the page has a username/password field, and I'd like to be able to collect that data from the user in a native way, and then do all that in the background. Theres n开发者_JAVA百科o API for the site, I'd just need to the code to find the fields, 'type' it in and press enter so I can start scraping data from the page that comes next.
Cheers
Rather than trying to fill out the form you could create a POST with NSURLConnection or ASIHTTPRequest (easier) that passes the user's authentication information to the server just like the login form does when you press Login.
Make sure you are storing their credentials safely though, look into the Keychain services for that.
精彩评论