C++ (Qt) QWebView *wbQre = new QWebView(); wbQre->load(QUrl(link)); wbQre->show(); QWebFrame* frame = wbQre->page()->currentFrame(); if (frame!=NULL) { QWebElement collection = frame->findFirstElement("input[type='text']"); collection.setAttribute("value", "qt webkit autocomplete an input"); }
C++ (Qt) QWebElement frame = wbQre->page()->mainFrame()->documentElement(); QWebElement collection = frame.findFirst("#entry_665195659"); if (collection.isNull()) { qDebug() << "None"; }
C++ (Qt) QWebElement frame = wbQre->page()->mainFrame()->documentElement(); QWebElement collection = frame.findFirst("<input id=\"entry_665195659\">"); if (collection.isNull()) { qDebug() << "None"; }
C++ (Qt) QWebView *wbQre = new QWebView(); wbQre->load(QUrl(link)); wbQre->show(); QEventLoop loop; connect(wbQre, SIGNAL(loadFinished()), &loop, SLOT(quit())); loop.exec(); QWebElement frame = wbQre->page()->mainFrame()->documentElement(); QWebElement collection = frame.findFirst("#entry_665195659"); collection.setAttribute("value", "qqq");
Python def _find_restore_hp_window(self): for el in self.mw.doc.findAll('.alert'): title = el.findFirst('#alert-title') if not title.isNull() and title.toPlainText() == 'Восстановить здоровье': logger.debug('Найдено окно восстановления жизней.') self._restore_hp_window = el self._find_restore_hp_window_finded.emit() self._timer.stop() return
C++ (Qt) QNetworkProxyFactory::setUseSystemConfiguration(true); QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); QWebView *wbQre = new QWebView(); wbQre->load(QUrl(link)); wbQre->show(); QEventLoop loop; QObject::connect(wbQre, SIGNAL(loadFinished(bool)), &loop, SLOT(quit())); loop.exec(); QWebElement frame = wbQre->page()->mainFrame()->documentElement(); QWebElement collection = frame.findFirst("input[type=\"text\"]"); collection.setAttribute("value", protocol->getClientName());