Results 1 to 2 of 2

Thread: Is it possible to login to a site and use QtWebkit

  1. #1
    Join Date
    Nov 2015
    Location
    UK
    Posts
    8
    Qt products
    Platforms
    Windows

    Default Is it possible to login to a site and use QtWebkit

    Hi guys,

    I'm not sure if this is the right section for this but I'm certainly a Newbie so here goes. My aim is to log into a website and download a number of web pages as PDF's.
    I'm using Python 2.7 and pyqt4 and have found numerous scripts and ways to download web pages as PDF's but none of them seem to allow login and also the download of multiple web pages to PDF's together.
    I have a script that uses QtWebkit, takes a url or number of and saves the web page/pages to a local folder as PDF's, as I say this works fine until there is a need to login to a site or handle cookies.
    I could do the login and session/cookie handling with 'requests' or 'urllib' and cookielib but then cant load the url's with QtWebkit, I just don't seem to be able to find a way to combine the functionality of login and cookies with the PDF saving.
    Or is there a way give login details with QtWebkit.

    Cheers
    Steve

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Is it possible to login to a site and use QtWebkit

    You can set the credentials on the QUrl you pass to QWebFrame::load()
    Your QWebPage uses a QNetworkAccessManager (which you can retrieve a pointer to) to perform the network activity. QNetworkAccessManager emits a signal authenticationRequired() when it is requested to by the remote site. You could connect that signal to a slot that returns the correct authenticator details.

Similar Threads

  1. I am new in this site
    By Leydislan in forum Newbie
    Replies: 0
    Last Post: 7th April 2010, 06:58
  2. about this site
    By incapacitant in forum General Discussion
    Replies: 7
    Last Post: 2nd February 2006, 21:32

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.