Important: Please read the Qt Code of Conduct -

Write simple web client for website

  • I want to try to write simple web client for one website. My client should be able to pass authorization (send data for two text fields), push simple buttons and click checkboxes on current page. I need not view page, go back/next or download something (so I do not want to create browser, only simple client, where I can hardcode urls). To be more common, I must understand how to parse page elements and create requents with actions I described above (also, if it requires authorization, should it somehow save session?).

    I just started learn network modules in Qt, so I am quite confused with QWebEngine, QWebKit, QNetwork modules - what of them is most suitable for me? Any literature and examples are welcome. Thanks in advance.

  • Qt Champions 2017

    Since you are starting to learn, your idea is to check how web requests work in Qt, just start using the QNetworkAccessManager. Look at the some examples in Qt installation example directory or google. It will give you idea about you can start accessing the web server.

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What is exactly the goal of your application ? Provide a webpage to discuss with the backend ? Do a full custom GUI ?

  • Banned

    This post is deleted!

  • @SGaist
    TO make something like GUI wrapper for website. It is very inconvenient from usual browser. Also I want to learn a bit net programming in Qt.

  • Something like ?

    so I am quite confused with QWebEngine, QWebKit, QNetwork modules - what of them is most suitable for me?

    QtWebKit uses the same engine as apple's safari browser. the module has been discontinued since Qt 5.6
    QtWebEngine uses the same engine as google chrome and is used to interact with webpages html and the likes.
    QtNetwork is much more low level and is used to manage network communication. You can use QNetworkAccessManager to interact with http but if you need to run html/css/javascript on webpages, you are in the wrong place

  • @VRonin
    I see. Thank you, I found some examples, hope I will success one day.
    If I am not mistaken, I should use QHttpPart structure to set up sent data and send it.

  • @VRonin Now I am able to download page and read its headers. I see that page has html content-type ([Content-Type]: text/html; charset=utf-8), with some elements of which I should interact. Is it real with QNetwork tools?
    I can parse requested pages myself, all what I need is to send data in some html elements on current page.

  • Lifetime Qt Champion

    Do you want to show these pages to the user ?

  • @SGaist no, I will create gui elements based on parsed pages.
    Well, if I want to interact with html, I have to use QWebEngine anyway..

Log in to reply