Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved]Downlaod a whole website by Qt
QtWS25 Last Chance

[Solved]Downlaod a whole website by Qt

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 3.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stereomatching
    wrote on last edited by
    #1

    How could I donwload the whole website(like the function of chrome--save as webpage,complete) but not
    only the html by Qt?
    I find out there are wget and libcurl, do Qt provide some API to help us download a complete webpage?
    Thanks

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sportlover
      wrote on last edited by
      #2

      Could you be more specific?
      What do you mean by 'whole'?
      Do you want to crawl the website like a search engine does?
      Do you want the HTML, CSS, JavaScript?
      Do you want the images, movies?
      Or a combination! ;-)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stereomatching
        wrote on last edited by
        #3

        I want the HTML, CSS, JavaScript and image, if the movie could download it would be better.Thanks

        Sorry, I am pretty ignorant about web, that is why I didn't mention my problem specific.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sportlover
          wrote on last edited by
          #4

          You can use QNetworkAccessManager!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            stereomatching
            wrote on last edited by
            #5

            I used it already, but I have to parse the contents of the html by myself
            and the html are a bunch of words only, that means I have to parse
            different html with different rules. I want to find out a way to download
            the thumbnails(atleast) of the website without design different rule for
            different website.

            example :
            in the pure html file, I could find a link like
            <img src="thumb/1349462743660s.jpg

            but the true address is
            “http://2cat.or.tl/~tedc21thc/live/thumb/1349462743660s.jpg”

            how could I find out the address before "

            1 Reply Last reply
            0
            • U Offline
              U Offline
              uranusjr
              wrote on last edited by
              #6

              "QUrl documentation":http://doc.qt.digia.com/stable/qurl.html

              QUrl provides resolve() to find the absolute URL from the relative one with a base URL.

              In your example:
              @
              QUrl base("http://2cat.or.tl/~tedc21thc/live/");
              // Or "http://2cat.or.tl/~tedc21thc/live/index.html". resolve() can handle both versions correctly
              QUrl imageUrl = base.resolve("thumb/1349462743660s.jpg");
              // imageUrl is now "http://2cat.or.tl/~tedc21thc/live/thumb/1349462743660s.jpg"
              @

              By the way you're from Taiwan? (Guessed with the website you gave.) Happy to see a fellow countryman! =D

              1 Reply Last reply
              0
              • S Offline
                S Offline
                stereomatching
                wrote on last edited by
                #7

                Thanks, this is a big help.

                Sorry, I am not a Taiwanese but a Malaysian

                I just quit my job from Taiwan, because I can't bear with the rule
                of "Overworked & Underpaid".My boss don't want me to study
                everything "non-related" to jobs and order me don't participate
                any open source project in my spare times.

                "If you have times to study Qt, study the source codes of those useless project,
                you should spend all of your times on your job, if you don't want to do that,you
                can leave"

                Oh god, I study the books and codes in my spare times, what is the wrong with that?
                They think I am a slave and buy my live already?I don't know how those Taiwanese could
                bear these.

                1 Reply Last reply
                0
                • U Offline
                  U Offline
                  uranusjr
                  wrote on last edited by
                  #8

                  I guess most people just don't have a choice you know. Most Taiwanese bosses are just the same, be it hard to believe.

                  Godspeed in Malaysia because we're f***ed here in Taiwan.

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved