Originally Posted by
tuthmosis
Greetings !
Can someone point me to a demo or sample QT C++ code to load and parse HTML files at specific URLs ? (DHTML content)
Thanks !
read Qt Quarterly
is a sample to query image src ...
http://doc.trolltech.com/qq/qq25-webrobot.html
change it to query a/href
My method to load on qtextedit remote or local image is:
/// from http://www.qt-apps.org/content/show.php/XHTML+Wysiwyg+Qeditor?content=59493
void Load_Image_Connector()
{
QRegExp expression
( "src=[\"\'](.*)[\"\']", Qt
::CaseInsensitive );
expression.setMinimal(true);
int iPosition = 0;
int canna = 0;
while( (iPosition = expression.indexIn( html , iPosition )) != -1 ) {
QString semi1
= expression.
cap( 1 );
canna++;
dimage.append(semi1); /* image lista 1 */
AppendImage(semi1); /* image list local or remote */
iPosition += expression.matchedLength();
}
QTimer::singleShot(1,
this,
SLOT(GetRemoteFile
()));
}
/// from http://www.qt-apps.org/content/show.php/XHTML+Wysiwyg+Qeditor?content=59493
void Load_Image_Connector()
{
QRegExp expression( "src=[\"\'](.*)[\"\']", Qt::CaseInsensitive );
expression.setMinimal(true);
int iPosition = 0;
int canna = 0;
while( (iPosition = expression.indexIn( html , iPosition )) != -1 ) {
QString semi1 = expression.cap( 1 );
canna++;
dimage.append(semi1); /* image lista 1 */
AppendImage(semi1); /* image list local or remote */
iPosition += expression.matchedLength();
}
QTimer::singleShot(1, this, SLOT(GetRemoteFile()));
}
To copy to clipboard, switch view to plain text mode
other way is class ScribeParser
it parse the full document to find internal or external link
file http://fop-miniscribus.googlecode.co...panelcontrol.h
but all this way not parse javascript ... google robo bot engine it not can!
Bookmarks