2

I'm developing an app in android studio and I want to display a list of links on the website https://www.limerick.ie/council/weekly-planning-lists. However at the moment the webview displays the entire page.

Here is my code so far

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    WebView view = (WebView) this.findViewById(R.id.webView);
    view.getSettings().setJavaScriptEnabled(true);
    view.setWebViewClient(new MyBrowser());        
    view.loadUrl("https://www.limerick.ie/council/weekly-planning-lists");
}

This is all I want to display https://i.stack.imgur.com/G7cTJ.jpg

I have tried the solution given at Display a part of the webpage on the webview android but this does not seem to work for me as I am unaware of what html is supposed to be typed and where it is meant to typed in. I also get an error with the word "none".

The html that I want to show is:

<div class="block-inner clearfix">
Community
  • 1
  • 1
  • What are you trying to do? What works and what doesn't? It is unclear what your exact problem is. – Buurman Mar 04 '16 at 13:56
  • Sorry, forgot a pretty vital part of the issue in the original question. That's my bad. I've edited the question now. – General Disorder Mar 04 '16 at 14:07
  • How is the list pulled into the webpage? – luc122c Mar 04 '16 at 15:19
  • In webview the whole page is displayed as normal. On the webpage itself I think html.js is used to create the list. I have little to no understanding of html so I could be completely wrong here but I think the the html part is called . – General Disorder Mar 04 '16 at 16:06
  • I'd talk to your web developer and ask them how they generate the list. If it is dynamic data in XML, JSON or a similar format, you will be able to create a new page with just that section that updates the same as the main page. You can then link to this new page. – luc122c Mar 04 '16 at 16:09
  • Is there any way that solution given in http://stackoverflow.com/questions/12257929/display-a-part-of-the-webpage-on-the-webview-android could be altered in any way so that it could be applied to my issue? – General Disorder Mar 04 '16 at 16:22
  • Contacting county councils can be a long and laborious exercise and it's very unlikely that anyone there would have that kind of information. As this is for a college project and time is of the essence, I'd much rather avoid that route. – General Disorder Mar 04 '16 at 16:31
  • The http://www.jsoup.org/ plugin looks like your best bet as it says it can scrape HTML which is what you're looking for. I think what you're looking to do is scrape just the table? This will be tough as the website doesn't seem to use ID's so you're going to have a tough time identifying the correct table in your code. – luc122c Mar 04 '16 at 16:58

0 Answers0