Results 1 to 5 of 5

Thread: Auto login using java script

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2009
    Posts
    16
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    2

    Default Auto login using java script

    I am trying to use QWebpage to parse the data from http://www.wizards.com/dndinsider/co...r.aspx?id=3528. If the user isn't currently logged into the site it will redirect the user to a login page. If the user is redirected to the login page I want to automatically login. When I use the evaluateJavaScript call to fill in the email and password text boxes and submit the form it seems to fail to continue to the desired page. I have attached the test application I put together. Does anyone have any ideas why it wouldn't be working? The code to fill in the form and submit is the following:
    Qt Code:
    1. void Widget::on_ui_pushButtonLoad_clicked()
    2. {
    3. QWebFrame *frame = webView->page()->mainFrame();
    4. frame->evaluateJavaScript(
    5. QString( "document.getElementById('email').value = \"%1\";" ).
    6. arg( ui_lineEditName->text() ) );
    7. frame->evaluateJavaScript(
    8. QString( "document.getElementById('password').value = \"%1\";" ).
    9. arg( ui_lineEditPassword->text() ) );
    10. }
    11.  
    12. void Widget::on_ui_pushButtonSubmit_clicked()
    13. {
    14. QWebFrame *frame = webView->page()->mainFrame();
    15. frame->evaluateJavaScript( "document.forms[0].submit();" );
    16. }
    To copy to clipboard, switch view to plain text mode 

    Thanks for the help.
    Attached Files Attached Files

Similar Threads

  1. Java Script on Qt4.5
    By kavinsiva in forum Newbie
    Replies: 1
    Last Post: 7th October 2009, 13:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.