This line makes no sense and does not compile:
QString attr
= m_WebPage
->mainFrame
()->documentElement
().
setAttribute("Diablo 3 (Diablo III)",
"MySelection");
QString attr = m_WebPage->mainFrame()->documentElement().setAttribute("Diablo 3 (Diablo III)", "MySelection");
To copy to clipboard, switch view to plain text mode
setAttribute() does not return a value (it's void). In any case, you are trying to set an attribute on a default, empty HTML document because you have not loaded anything into your QWebPage.
If you want to drive the web page as if a user were doing it then you need to:
- load the web page into the QWebPage,
- wait until loadFinished(),
- locate the element representing the drop down list
- change its value
- locate the element representing the submit button, and
- fake clicking it.
Bookmarks