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++?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 2 Posters 1.9k Views
  • 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 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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
      0
      • SGaistS SGaist

        Hi,

        What kind of parsing do you have in mind ?

        I Offline
        I Offline
        Ibrahim
        wrote on 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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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
          0
          • SGaistS SGaist

            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 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
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on 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

              • Login

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