We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2016-12-18 19:03:35 +0200

Read HTML content

Hi I want to develop an app for Sailfish and I need to read some data from a website. What do I use writing a simple crawler? I'm reading my website using QNetworkRequest. But I don't know what to use to parse the HTML. This is what I have now:

void CCrawler::replyFinished(QNetworkReply* pReply) {

QByteArray data = pReply->readAll();
QString str(data);

//QWebPage page;
QWebFrame *frame = new QWebFrame();

frame->mainFrame()->setHtml(str);

QWebElement document = frame->documentElement();
QWebElementCollection elements = document.findAll("a");
foreach (QWebElement element, elements)
    qDebug() << element.toInnerXml();

}

But I get an error:

invalid use of incomplete type 'class QWebFrame

Read HTML content

Hi I want to develop an app for Sailfish and I need to read some data from a website. What do I use for writing a simple crawler? I'm reading my website using QNetworkRequest. But I don't know what to use to parse the HTML. This is what I have now:

void CCrawler::replyFinished(QNetworkReply* pReply) {

QByteArray data = pReply->readAll();
QString str(data);

//QWebPage page;
QWebFrame *frame = new QWebFrame();

frame->mainFrame()->setHtml(str);

QWebElement document = frame->documentElement();
QWebElementCollection elements = document.findAll("a");
foreach (QWebElement element, elements)
    qDebug() << element.toInnerXml();

}

But I get an error:

invalid use of incomplete type 'class QWebFrame

Read HTML content

Hi I want to develop an app for Sailfish and I need to read some data from a website. What do I use for writing a simple crawler? I'm reading my website using QNetworkRequest. But I don't know what to use to parse the HTML. This is what I have now:

void CCrawler::replyFinished(QNetworkReply* pReply) {

QByteArray data = pReply->readAll();
QString str(data);

//QWebPage page;
QWebFrame *frame = new QWebFrame();

frame->mainFrame()->setHtml(str);

QWebElement document = frame->documentElement();
QWebElementCollection elements = document.findAll("a");
foreach (QWebElement element, elements)
    qDebug() << element.toInnerXml();

}

But I get an error:

invalid use of incomplete type 'class QWebFrame

Read HTML content

Hi I want to develop an app for Sailfish and I need to read some data from a website. What do I use for writing a simple crawler? I'm reading my website using QNetworkRequest. But I don't know what to use to parse the HTML. This is what I have now:

void CCrawler::replyFinished(QNetworkReply* pReply) {

QByteArray data = pReply->readAll();
QString str(data);

//QWebPage page;
QWebFrame *frame = new QWebFrame();

frame->mainFrame()->setHtml(str);

QWebElement document = frame->documentElement();
QWebElementCollection elements = document.findAll("a");
foreach (QWebElement element, elements)
    qDebug() << element.toInnerXml();

}

But I get an error:

invalid use of incomplete type 'class QWebFrame

Read HTML content

I want to develop an app for Sailfish and I need to read some data from a website. What do I use for writing a simple crawler? crawler?

I'm reading my website using QNetworkRequest. But I don't know what to use to parse the HTML. This is what I have now:

void CCrawler::replyFinished(QNetworkReply* pReply) {

QByteArray data = pReply->readAll();
QString str(data);

//QWebPage page;
QWebFrame *frame = new QWebFrame();

frame->mainFrame()->setHtml(str);

QWebElement document = frame->documentElement();
QWebElementCollection elements = document.findAll("a");
foreach (QWebElement element, elements)
    qDebug() << element.toInnerXml();

}

But I get an error:

invalid use of incomplete type 'class class QWebFrame