PDA

View Full Version : Parsing a web page



sujoy.chowdhary
30th June 2010, 03:52
Hello All

I am trying to parse a web page which is rendered by the JSP engine residing on my local web server.

I am using QT as my client application. So the idea is to parse the page rendered by the server. For e.g. if the page delivered stands as :
<body>
<H1>200789</H1>
</body>

I want to parse out the numeral 200789 and show it in a QT label or line edit.

So can anyone help me with some code snippets here.

Thanks in advance

Sujoy

tbscope
30th June 2010, 04:40
If the html is as close to xml as the example you posted, then you can use a standard qt xml class.

sujoy.chowdhary
30th June 2010, 05:47
If the html is as close to xml as the example you posted, then you can use a standard qt xml class.

Actually the page rendered will be a simple HTML page with some style sheet elements. All I want is to get a particular text from the html page. You can refer the sample I gave earlier

Talei
30th June 2010, 06:59
AFAIK QRegexp is the fastest and simplest way for this purpose..