If you need a utility to automate form fillings then you may want to look at curl. Some instructions are here and here.
If you want to write your own application then (as for me) I see here a problem, that loading of a page is not a blocking operation. In this case you will have to sleep and check for the loading. So, here an approximate pseudo code:
somefunction() {
webView->load(yourUrl);
while (!pageLoaded()) {
sleep(nSeconds);
}
// do your processing here
}
somefunction() {
webView->load(yourUrl);
while (!pageLoaded()) {
sleep(nSeconds);
}
// do your processing here
}
To copy to clipboard, switch view to plain text mode
So we already have one more function, which is:
bool YourModule::pageLoaded()
{
return mPageLoaded;
}
bool YourModule::pageLoaded()
{
return mPageLoaded;
}
To copy to clipboard, switch view to plain text mode
Obviously mPageLoaded is set to FALSE at the very beginning, so when the page is loaded it should be set to TRUE, so that we exit that while loop. They only way we can do it (at least the only that I found) with the help of QWebView, is connect loadFinished(bool ok) signal of QWebView to your slot and your slot will set mPageLoaded to TRUE, i.e.
connect(youWebView, SIGNAL(loadFinished(bool)), this, SLOT(pageLoaded(bool)));
...
void YourModule::pageLoaded(bool iOk)
{
mPageLoaded = true;
}
connect(youWebView, SIGNAL(loadFinished(bool)), this, SLOT(pageLoaded(bool)));
...
void YourModule::pageLoaded(bool iOk)
{
mPageLoaded = true;
}
To copy to clipboard, switch view to plain text mode
This is the solution I see at this point.
Bookmarks