Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Parsing HTML content

Parsing HTML content

Scheduled Pinned Locked Moved Solved General and Desktop
htmlqwebkit
5 Posts 3 Posters 2.7k 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.
  • B Offline
    B Offline
    Bagavathi
    wrote on 10 Dec 2015, 11:34 last edited by
    #1

    I've the HTML file, which is having the data in the form of tables <Table>. I want to extract those data to my application. What is the correct method to parse the data? and please suggest me any tutorials or examples, if possible.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Dec 2015, 23:12 last edited by
      #2

      Hi and welcome to devnet,

      Since html is xml, you can use Qt's xml module to do what you want.

      Hope it helps

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

      B 1 Reply Last reply 11 Dec 2015, 08:16
      0
      • S SGaist
        10 Dec 2015, 23:12

        Hi and welcome to devnet,

        Since html is xml, you can use Qt's xml module to do what you want.

        Hope it helps

        B Offline
        B Offline
        Bagavathi
        wrote on 11 Dec 2015, 08:16 last edited by
        #3

        Hi SGaist,

        Thank you very much for you reply. I'ii try with Qt's xml module.

        1 Reply Last reply
        0
        • C Online
          C Online
          Chris Kawa
          Lifetime Qt Champion
          wrote on 11 Dec 2015, 14:19 last edited by
          #4

          @SGaist Since html is xml (...)
          It's not! XHTML is, but it's in rapid decline in favor of Html5. Html has a lot less stricter rules, noticeably a lot of tags don't require a closing tag, which will trip xml parsers.
          Qt's xml parser will work or not, depending on how close to xml the html code is.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 11 Dec 2015, 15:59 last edited by
            #5

            Good point, I should have added that if it's only to parse html tables, the XML parser should be enough.

            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

            3/5

            11 Dec 2015, 08:16

            • Login

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