Reputation: 4259
I'm loading a 3rd party website into my app using WebView. But there is a lot of items I don't want to see. Is there a way to parse just the pieces that I want?
Upvotes: 1
Views: 242
Reputation: 1006799
Yes, if you:
loadDataWithBaseURL()
to load the HTML into the WebView
yourself, using your original URL as the "base URL" so relative links and images work.Or, since this is hopefully your Web server, you simply create a separate Web page that has what you want.
Or, if it is not your Web server, use the site's Web service API instead of scraping Web content, which is intrinsically unreliable, since minor changes in the page layout may break your parsing logic.
Or, just display the "lot of items".
Upvotes: 2