With Objective-C, what is the best way to log in to a service and scrape content from the resulting page without an API?

前端 未结 2 2191
心在旅途
心在旅途 2021-01-24 06:44

One service I\'m using doesn\'t have an API, but allows scraping, so I\'m curious what the best way in iOS/Objective-C would be to do the following:

  • Get user login
2条回答
  •  悲&欢浪女
    2021-01-24 07:28

    There is nothing specific to iOS or Objective-C in what you are trying to do. If you know how to process HTTP responses and know how to detect your login page, all you have to do is parse the response and submit credentials to the login end point when you detect the response is your login page. Before you get started, do read the documentation on NSURLConnection.

提交回复
热议问题