Re: Fill input in QWebView
Re: Fill input in QWebView
You're asking what to use to fill the inputs and at the same time you wrote
Quote:
Usually when I change value of input and I send it,
What are you using now to change the value of input, then? Can you show some code?
Re: Fill input in QWebView
I mean, that when I change value usually it works. I don't use other way. I ask you about another way to fill all, not part of inputs.
I know that it's possible to do it in Qt, because I saw one program in Qt which can do it ;]
Re: Fill input in QWebView
Quote:
Originally Posted by
RzuF
I ask you about another way to fill all, not part of inputs.
I don't understand above statement.
Can you show the code you're using now to set value of input fields and submit a form?
Re: Fill input in QWebView
Code:
doc = ui->webView->page()->mainFrame()->documentElement();
QWebElement login = doc.findFirst("input[id=\"login\"]");
QWebElement password = doc.findFirst("input[id=\"password\"]");
QWebElement password_conf = doc.findFirst("input[id=\"password_conf\"]");
QWebElement answer = doc.findFirst("input[id=\"secret_a\"]");
QWebElement recapatcha = doc.findFirst("input[id=\"recaptcha_response_field\"]");
login.setAttribute("value", ui->lineEdit->text());
password.setAttribute("value", ui->lineEdit_2->text());
password_conf.setAttribute("value", ui->lineEdit_2->text());
answer.setAttribute("value", ui->lineEdit_3->text());
recapatcha.setAttribute("value", ui->lineEdit_4->text());
I only fill inputs and I sumbit it by myself in QWebView. It hard to me, explain this what I want to do. But I belive you will understand me ;]
EDIT:
I think that I should use Requests to do it, am I on good way?