The best way is Tidy the html or xml code

http://fop-miniscribus.googlecode.co...dy/bestqtidy.h
class QTidy
qt4 compatible lib...
http://fop-miniscribus.googlecode.co.../modules/tidy/

after you can parse as xml and read/write all your own chunk html...

or if you search only image on html code to load.....


Qt Code:
  1. /* read remote image from html code */
  2. void Load_Image_Connector()
  3. {
  4. ///////////////////qDebug() << "### Load_Image_Connector";
  5.  
  6. QRegExp expression( "src=[\"\'](.*)[\"\']", Qt::CaseInsensitive );
  7. expression.setMinimal(true);
  8. int iPosition = 0;
  9. int canna = 0;
  10. while( (iPosition = expression.indexIn( html , iPosition )) != -1 ) {
  11. QString semi1 = expression.cap( 1 );
  12. canna++;
  13. dimage.append(semi1); /* image lista 1 */
  14. AppendImage(semi1); /* register qmap images & name & replace qurl remove css file */
  15. iPosition += expression.matchedLength();
  16. ////////////////////qDebug() << "### iPosition " << iPosition;
  17. }
  18. QTimer::singleShot(1, this, SLOT(GetRemoteFile()));
  19.  
  20. }
To copy to clipboard, switch view to plain text mode