×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2006
    Location
    Beijing, China
    Posts
    386

    how to parse html

    Hi,

    I have some perl code I'm trying to port to Qt and it uses HTML::TreeBuilder to parse some html, which enables me to extract various bit of data from that html.

    I've had a dig through the Qt documentation, but I haven't been able to find anything to replace that part of the perl script.

    Can someone enlighten me?

    Thanks,

    Max.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: how to parse html

    AFAIK there is no direct API to parse HTML file in Qt.

  3. #3
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: how to parse html

    You can use QWebKit to get a DOM representation of the web page.
    http://qt.nokia.com/doc/4.6/qtwebkit.html
    QWebElement provides convenient access to DOM elements in a QWebFrame:
    http://qt.nokia.com/doc/4.6/qwebelement.html

  4. #4
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: how to parse html

    You should be able to use the QtXml support, if the HTML is well-formed (ie, passes http://validator.w3.org/ at the HTML 4 "strict" level). (Unfortunately, very little HTML "in the wild" is well-formed.)

  5. #5
    Nokia Developer Champion
    Join Date
    Dec 2008
    Posts
    2,357

    Re: how to parse html

    You can also use CHtmlContol, its an open source lib.
    see this thread
    http://discussion.forum.nokia.com/fo...d.php?t=188928

Similar Threads

  1. Displaying an HTML File
    By B.A in forum Symbian
    Replies: 4
    Last Post: 2009-06-10, 12:26
  2. How to get the data from an HTML Form
    By aditya4180 in forum Symbian
    Replies: 3
    Last Post: 2007-06-20, 13:58
  3. Replies: 11
    Last Post: 2007-02-28, 04:16

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×