Originally Posted by
anda_skoa
QWebEnginePage should emit the authenticationRequired() signal when it encounters the login, so you could provide the login data in a slot connected to that.
_
I tried using this approach but was unsuccessful. Here is the link of the login page I am trying to automatically log into. I created connection between the authenticationRequired() signal and the mineTenders(const QUrl &requestUrl, QAuthenticator* authenticator) slot, however I don't thing the signal is getting emitted at any point during execution.
I've got this line of code below linked to a pushbutton slot.
web_view->set_Url("http://web1.capetown.gov.za/web1/TenderPortal/Account/LogOn?ReturnUrl=%2fweb1%2fTenderPortal%2fTender%2fDetails%2f116559");
web_view->set_Url("http://web1.capetown.gov.za/web1/TenderPortal/Account/LogOn?ReturnUrl=%2fweb1%2fTenderPortal%2fTender%2fDetails%2f116559");
To copy to clipboard, switch view to plain text mode
The idea is that when I push the button, the above page is suppose to load already logged in. Now code below is my slot with the authenticator and know that this slot can't possibly work, but unfortunately I am a bit lost as to how to achieve my goal.
void WebView
::mineTenders(const QUrl &requestUrl, QAuthenticator
* authenticator
) {
authenticator->setUser("myemail@someemailserver.com");
authenticator->setPassword("password");
//qDebug() << "signal emitted" <<endl;
}
void WebView::mineTenders(const QUrl &requestUrl, QAuthenticator* authenticator)
{
authenticator->setUser("myemail@someemailserver.com");
authenticator->setPassword("password");
//qDebug() << "signal emitted" <<endl;
}
To copy to clipboard, switch view to plain text mode
How can I send the username and password to the server?
Bookmarks