Results 1 to 4 of 4

Thread: Parsing a web page

  1. #1
    Join Date
    Jun 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Parsing a web page

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Parsing a web page

    If the html is as close to xml as the example you posted, then you can use a standard qt xml class.

  3. #3
    Join Date
    Jun 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: Parsing a web page

    Quote Originally Posted by tbscope View Post
    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

  4. #4
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Parsing a web page

    AFAIK QRegexp is the fastest and simplest way for this purpose..

Similar Threads

  1. How can I support page up/page down on QTextEdit
    By wesley in forum Qt Programming
    Replies: 7
    Last Post: 14th September 2010, 19:18
  2. DTD Parsing in qt4?
    By darshan.hardas in forum Qt Programming
    Replies: 0
    Last Post: 1st July 2009, 10:39
  3. QTabWidget remove a page at the page's request
    By thomaspu in forum Qt Programming
    Replies: 2
    Last Post: 29th December 2007, 20:45
  4. XML Parsing in Qt 3.3
    By ToddAtWSU in forum Qt Programming
    Replies: 5
    Last Post: 18th April 2007, 18:54
  5. Xml parsing
    By probine in forum Qt Programming
    Replies: 4
    Last Post: 15th December 2006, 11:28

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.