Results 1 to 4 of 4

Thread: Reading data from a website without specified url

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Reading data from a website without specified url

    Hello d_stranz,

    first thanks for the reply. I was able to 'get' the link your provided, but when I read the content, I get no data (and no errors are mentioned):

    Qt Code:
    1. void MainWindow::slotMainClock()
    2. {
    3. netAccMan->get(QNetworkRequest(QUrl("https://www.muonline.com.br/onlines.php")));
    4. }
    5.  
    6. void MainWindow::slotDownloadFinished(QNetworkReply* reply)
    7. {
    8. if (reply->error() != QNetworkReply::NoError)
    9. {
    10. qDebug() << "Error: " << reply->error();
    11. return;
    12. }
    13.  
    14. qDebug() << "Reading";
    15. qDebug() << reply->readAll();
    16. }
    To copy to clipboard, switch view to plain text mode 

    I couldn't figure out what's happening!
    May the Lord be with you. Always.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,329
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Reading data from a website without specified url

    I couldn't figure out what's happening!
    Sorry, can't help you either. Probably what happens in the browser is different from what occurs with your QNetworkRequest. As I remember, the capture of your web page also had references to a couple of javascript files - these may be doing client-side formatting of the PHP output, as described here.
    <=== 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.

  3. The following user says thank you to d_stranz for this useful post:

    Momergil (29th June 2017)

Similar Threads

  1. Reading UDP data properly
    By ankit.1g@gmail.com in forum Newbie
    Replies: 3
    Last Post: 16th February 2016, 12:34
  2. read data from website
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 4
    Last Post: 27th June 2013, 11:32
  3. Replies: 0
    Last Post: 10th September 2011, 13:38
  4. Reading data from socket
    By ComaWhite in forum Qt Programming
    Replies: 1
    Last Post: 4th December 2008, 18:22
  5. Reading binary data
    By vermarajeev in forum Qt Programming
    Replies: 1
    Last Post: 13th August 2007, 09:14

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
  •  
Qt is a trademark of The Qt Company.