KingPolygon
KingPolygon

Reputation: 4755

iOS: Scraping Data from a Site Requiring Authentication?

I want to scrape data off a site that requires authentication. However, even though I've come across many tutorials regarding scraping, I can't seem to find one that also mentions logging in. I know how to send values using javascript injection but I don't know how to then load the data right after that, or even know if it worked.

Is there any examples or tutorials that you know of that can get me started? I'm not sure if this matters but the site where authentication happens ends in .asp

Thank you!!!

Upvotes: 0

Views: 332

Answers (1)

Antzi
Antzi

Reputation: 13444

Can you inject the password in JS ?

AFHTTPClient also handle authentication:

AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
[httpClient setAuthorizationHeaderWithUsername:@"username" password:@"password"];

http://afnetworking.github.io/AFNetworking/Classes/AFHTTPClient.html

Upvotes: 1

Related Questions