QT program tips
1、QT QWebengine运行JavaScript获取图片的数量
pView->page()->runJavaScript("document.getElementsByTagName(\"img\").length",[](QVariantresult){qDebug()<<result.toString();});
或者
structGetElementCountFunctor{GetElementCountFunctor(){}voidoperator()(constQVariant&result){qDebug()<<result.toString();}};pView->page()->runJavaScript("document.getElementsByTagName(\"img\").length",GetElementCountFunctor());
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。