Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How can I parsing html in Qt by C++?
Servers for Qt installer are currently down

How can I parsing html in Qt by C++?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 2 Posters 2.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ibrahim
    wrote on 26 Feb 2016, 20:54 last edited by
    #1

    Hi; I want to parsing html in Qt by C++. I will develop html parser for desktop and mobile application. Which can I use C++ module for html parser? Thanks.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 26 Feb 2016, 20:59 last edited by
      #2

      Hi,

      What kind of parsing do you have in mind ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply 26 Feb 2016, 21:15
      0
      • S SGaist
        26 Feb 2016, 20:59

        Hi,

        What kind of parsing do you have in mind ?

        I Offline
        I Offline
        Ibrahim
        wrote on 26 Feb 2016, 21:15 last edited by
        #3

        @SGaist Example: <html><body><a href="www.xxx.yyy">Click Me!</a></body></html>
        I want to get www.xxx.yyy and Click Me!. How can I do that?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 26 Feb 2016, 21:32 last edited by
          #4

          There's the QWebElement class that could be of use but it's in the deprecated QtWebKit module.

          But are you looking for a library to do the parsing or write your own ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply 26 Feb 2016, 21:58
          0
          • S SGaist
            26 Feb 2016, 21:32

            There's the QWebElement class that could be of use but it's in the deprecated QtWebKit module.

            But are you looking for a library to do the parsing or write your own ?

            I Offline
            I Offline
            Ibrahim
            wrote on 26 Feb 2016, 21:58 last edited by
            #5

            @SGaist I looked some html parser library. There is not a library or module in Qt 5.5.1 or Qt 5.6? Else should I use a html parser library or write my own library by QRegExp?

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 26 Feb 2016, 22:14 last edited by
              #6

              If you know in advance the html you want to parse and that it fits in the xml category you can use the QXmlStreamReader class. For example, you html snippet should be parsed without any problem.

              If you want to use regular expressions go with QRegularExpression.

              Again, it depends on what exactly you need. If it's to parse any and every html page then you should consider a dedicated library.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              1/6

              26 Feb 2016, 20:54

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved