Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. How to conutinue
Qt 6.12 LTS is out! See what's new in the release blog

How to conutinue

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
18 Posts 4 Posters 3.5k Views 1 Watching
  • 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.
  • jsulmJ jsulm

    @SeaLongHoang said in How to conutinue:

    self.manager.finished.connect(self.handle_response)

    Then fix this line...

    self.manager().finished.connect(self.handle_response)
    
    SeaLongHoangS Offline
    SeaLongHoangS Offline
    SeaLongHoang
    wrote on last edited by SeaLongHoang
    #9

    @jsulm Thank you for your advice, but it is still has a bug. When I run it, it returns this:

    QObject::connect: No such signal QObject::finished(QNetworkReply*)
    
    1 Reply Last reply
    0
    • jsulmJ jsulm

      @SeaLongHoang said in How to conutinue:

      self.manager.finished.connect(self.handle_response)

      Then fix this line...

      self.manager().finished.connect(self.handle_response)
      
      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #10

      @jsulm In my original code I use cached_property so you should not modify it but import it: from functools import cached_property

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      SeaLongHoangS 1 Reply Last reply
      0
      • eyllanescE eyllanesc

        @jsulm In my original code I use cached_property so you should not modify it but import it: from functools import cached_property

        SeaLongHoangS Offline
        SeaLongHoangS Offline
        SeaLongHoang
        wrote on last edited by
        #11

        @eyllanesc Thank you very much, however I believe you could examine your code more carefully at times, such as this lineself.process(reply.readAll().encode("utf-8")) it must be self.process(str(reply.readAll(), 'utf-8'))

        jsulmJ 1 Reply Last reply
        0
        • SeaLongHoangS SeaLongHoang

          @eyllanesc Thank you very much, however I believe you could examine your code more carefully at times, such as this lineself.process(reply.readAll().encode("utf-8")) it must be self.process(str(reply.readAll(), 'utf-8'))

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #12

          @SeaLongHoang said in How to conutinue:

          however I believe you could examine your code more carefully at times

          Well, people here are volunteers and don't have to write exact and tested code. You should adjust the code as needed if something is wrong there.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          SeaLongHoangS 1 Reply Last reply
          1
          • jsulmJ jsulm

            @SeaLongHoang said in How to conutinue:

            however I believe you could examine your code more carefully at times

            Well, people here are volunteers and don't have to write exact and tested code. You should adjust the code as needed if something is wrong there.

            SeaLongHoangS Offline
            SeaLongHoangS Offline
            SeaLongHoang
            wrote on last edited by SeaLongHoang
            #13

            @jsulm Okay, I get that, and I appreciate all of your assistance, but I have a little question for you: how can I continue to locate elements from that new request?

            @eyllanesc said in How to conutinue:

               self.start_request(QtCore.QUrl(url))
            
            jsulmJ 1 Reply Last reply
            0
            • SeaLongHoangS SeaLongHoang

              @jsulm Okay, I get that, and I appreciate all of your assistance, but I have a little question for you: how can I continue to locate elements from that new request?

              @eyllanesc said in How to conutinue:

                 self.start_request(QtCore.QUrl(url))
              
              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #14

              @SeaLongHoang said in How to conutinue:

              how can I continue to locate elements from that new request?

              What do you mean by that?
              If you mean how to handle the response - that is what handle_response() slot does.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              SeaLongHoangS 1 Reply Last reply
              0
              • jsulmJ jsulm

                @SeaLongHoang said in How to conutinue:

                how can I continue to locate elements from that new request?

                What do you mean by that?
                If you mean how to handle the response - that is what handle_response() slot does.

                SeaLongHoangS Offline
                SeaLongHoangS Offline
                SeaLongHoang
                wrote on last edited by SeaLongHoang
                #15

                @jsulm I mean, if I want to keep getting elements like this from new requests, what should I do? You may view the code below.

                html = HTML(html=data)
                rs = html.find("#list-chapter a", first=False)
                for i in reversed(rs):
                            url = "https://saytruyen.net/" + i.attrs["href"]
                            self.start_request(QtCore.QUrl(url))
                
                jsulmJ 1 Reply Last reply
                0
                • SeaLongHoangS SeaLongHoang

                  @jsulm I mean, if I want to keep getting elements like this from new requests, what should I do? You may view the code below.

                  html = HTML(html=data)
                  rs = html.find("#list-chapter a", first=False)
                  for i in reversed(rs):
                              url = "https://saytruyen.net/" + i.attrs["href"]
                              self.start_request(QtCore.QUrl(url))
                  
                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #16

                  @SeaLongHoang said in How to conutinue:

                  what should I do?

                  Nothing special. For each request handle_response() will be called which has parameter "reply".

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  SeaLongHoangS 1 Reply Last reply
                  1
                  • jsulmJ jsulm

                    @SeaLongHoang said in How to conutinue:

                    what should I do?

                    Nothing special. For each request handle_response() will be called which has parameter "reply".

                    SeaLongHoangS Offline
                    SeaLongHoangS Offline
                    SeaLongHoang
                    wrote on last edited by
                    #17

                    @jsulm What should I replace "...." with in this line html = HTML(html=....) after request to source code HTML from url self.start_request(QtCore.QUrl(url))

                    jsulmJ 1 Reply Last reply
                    0
                    • SeaLongHoangS SeaLongHoang

                      @jsulm What should I replace "...." with in this line html = HTML(html=....) after request to source code HTML from url self.start_request(QtCore.QUrl(url))

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #18

                      @SeaLongHoang Please take a closer look at the code @eyllanesc gave you.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      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
                      • Unsolved