Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help with HTML parsing

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

I need to take a table from a website and put it into an app. My methodology is this: connect to a site, place html into a string, place table data into a webview. I have successfully connected to the website, placed the HTML into a variable called myString and have even the loaded myString into a webview as a test.

My question is what is the best way to only load the <table> everything here </table>. In other words, I only want the table data.
I have experimented with xpath but can't seem to get it to work.
Also, looking ahead to the next step I will ultimately have to change the padding and whatnot of the table to make it look better on the device correct?

Thank you very much for your help.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The XmlFaq points to some libraries that transform HTML to XML and so make it more amenable to processing. For a mobile app I would probably forgo HTML completely; in other words, extract all the relevant data, and then use a native GUI to display it.
 
A timing clock, fuse wire, high explosives and a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic