2014年7月1日 星期二

[Qt4] How I can get all “input” elements from webview ?

[Qt4] How I can get all “input” elements from webview ?


void Class::getElements()
{
    QWebElementCollection collection = ui->cseriveOpenAPI_WebView->page()->mainFrame()->findAllElements("input");
    foreach (QWebElement element, collection)
    {
        qDebug() << "title:" << element.attribute("title");
    }
}
 
Ref :
https://qt-project.org/forums/viewthread/28920
http://qt-project.org/forums/viewthread/11604
http://stackoverflow.com/questions/2034981/how-to-manipulate-pages-content-inside-webkit-window-using-qt-and-qtwebkit



沒有留言:

張貼留言