Important: Please read the Qt Code of Conduct -

Setting attribute in webpage and press button 'GO'

  • Banned

    I am developing a web application. I need to select an option from dropdown in a website and press 'GO' button.

    I am connect with the website like as below.

    QNetworkAccessManager m_manager = new QNetworkAccessManager(this);
    connect(m_manager, SIGNAL(finished(QNetworkReply
    )), this, SLOT(replyFinished(QNetworkReply*)));

    m_WebPage = new QWebPage();
    QString attr = m_WebPage->mainFrame()->documentElement().setAttribute("Diablo 3 (Diablo III)", "MySelection");

    but with this my application crashing. Please tell me how can set an attribute in a webpage and press go. How can I get the attribute and the button 'GO' in my application.

    Any suggestions is highly appreciated. Thanks Sujan

  • Banned

    To select 2 options I do the following. And also click. But the values in my QWebView are not changing based on this. Please help whats wrong going on.

    QWebElement selectBox =

    selectBox.setAttribute("value", "187");
    QWebElement selectBox2 =
    selectBox2.setAttribute("value", "24351");
    QWebElement button = m_WebView->page()->mainFrame()->documentElement().findFirst("input[type=button]");


Log in to reply