How to conutinue
-
@SeaLongHoang said in How to conutinue:
self.manager.finished.connect(self.handle_response)
Then fix this line...
self.manager().finished.connect(self.handle_response)@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*) -
@SeaLongHoang said in How to conutinue:
self.manager.finished.connect(self.handle_response)
Then fix this line...
self.manager().finished.connect(self.handle_response) -
@jsulm In my original code I use cached_property so you should not modify it but import it:
from functools import cached_property@eyllanesc Thank you very much, however I believe you could examine your code more carefully at times, such as this line
self.process(reply.readAll().encode("utf-8"))it must beself.process(str(reply.readAll(), 'utf-8')) -
@eyllanesc Thank you very much, however I believe you could examine your code more carefully at times, such as this line
self.process(reply.readAll().encode("utf-8"))it must beself.process(str(reply.readAll(), 'utf-8'))@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.
-
@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.
@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)) -
@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))@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. -
@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.@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)) -
@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))@SeaLongHoang said in How to conutinue:
what should I do?
Nothing special. For each request handle_response() will be called which has parameter "reply".
-
@SeaLongHoang said in How to conutinue:
what should I do?
Nothing special. For each request handle_response() will be called which has parameter "reply".
@jsulm What should I replace "...." with in this line
html = HTML(html=....)after request to source code HTML from urlself.start_request(QtCore.QUrl(url)) -
@jsulm What should I replace "...." with in this line
html = HTML(html=....)after request to source code HTML from urlself.start_request(QtCore.QUrl(url))@SeaLongHoang Please take a closer look at the code @eyllanesc gave you.