[Qt-interest] Html parsing

Frédéric LECONTE fred.leconte2 at wanadoo.fr
Mon Dec 1 15:31:40 CET 2008


Le lundi 01 décembre 2008 14:57:14 Sean Harmer, vous avez écrit :
> Hi,
>
> On Monday 01 December 2008 13:48:10 Frédéric LECONTE wrote:
> > What the best solution to parse html page ?
>
> Define best ;-)
well, my elementary pb is that I want to use Google translate web page( the 
web page itself has no importance)  in my program.
So I post my source text and retrieve Google web page. But I didn't find easy 
way to fetch translated text
( It's just exercise, trying to learn...)
>
> > I tried to parse it with QXmlStreamReader but like I thought my web page
> > is not valid xml( not a XHTML page. for information the web page I try to
> > parse is translate.google.fr).
>
> One method is to run the html document through something that can convert
> it to a valid XML document such as htmltidy.
I don't want to valid my web page, I don't need to re-use it 
>
> > Can I use QWebPage, not display it on screen and find a way to get
> > certain fields ?
>
> You can access elements via javascript which has been discussed many times
> on the list.
>

It sounds like a complicated way to do a simple thing... 
No simpliest code ?

PS: I'm newcomer.






More information about the Qt-interest-old mailing list