Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Parse HTML using QRegExp



  • Hi there.

    I am trying to get a list of values out from an HTML file and had no luck so far with QXmlStreamReader as the documentation suggests.

    The entries I am interested in look like this:

    @<a data-track="something" href="someurl" title="Heaven"><img src="somesource.jpg" /></a>@

    and I am trying to extract someurl from it.

    That's what I've coded so far: http://codepad.org/SFwRAIyR (sorry for external link but the editor could not take it correctly here)

    What I get from the code you just saw is the first someurl i'm interested in and the whole HTML string follows, which is not what I want (list.length() == 1, while I need list.length() == n, where n is the number of someurl entries inside my HTML string).

    Any help appreciated as I wasted my whole afternoon and night for making this to work to no avail!


Log in to reply