Results 1 to 4 of 4

Thread: How to access data from web

  1. #1
    Join Date
    Jun 2018
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default How to access data from web

    I am doing a program to calculate my electric power payment, for this I need to obtain the cost per kWh from the official website of the company that offers the service. How do I connect to your website and get the cost of kWh data?
    Thanks for help me.

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

    Default Re: How to access data from web

    Fetch the data with these main classes:
    Demonstrated in this example: HTTP example

    Then you have to parse the response (maybe HTML, maybe something else) to find the magic number you seek.

  3. #3
    Join Date
    Jun 2018
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: How to access data from web

    Hello, thanks for answering.
    I have found information on the subject and I have understood that the recommended format is XML, the file is downloaded and read with an XML parser. Do you know if you can do this with Qt? How do I put my username and password to the page through my program to access my user data on the official website of the company?
    Thanks a lot.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,307
    Thanks
    244
    Thanked 678 Times in 668 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: How to access data from web

    The answers are going to depend on the specific protocol the company's site uses for these kinds of requests. You probably need to ask someone in the company's IT department about this, or search their web site for information. Every site will be different.

    It is unlikely that their protocol would involve sending your username and password in clear text. That would be a pretty bad security hole.

    Qt has a complete set of classes for handling XML, if that is the way your company provides data when you send a query.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Access data from QSqlTableModel
    By qlands in forum Qt Programming
    Replies: 4
    Last Post: 5th July 2011, 16:23
  2. Replies: 1
    Last Post: 29th June 2011, 21:35
  3. How do I access data between threads
    By yodasoda in forum Qt Programming
    Replies: 3
    Last Post: 26th February 2010, 20:10
  4. QThread Data Access Method
    By schan117 in forum Qt Programming
    Replies: 7
    Last Post: 18th August 2009, 07:25
  5. Replies: 2
    Last Post: 18th December 2008, 08:43

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.