how does requests-html get the innerText of a tag
def stage_catch():
session = HTMLSession()
r = session.get("http://www.dmzx.com/manhua/358/")
div = r.html.find(".subsrbelist")
list_a = div[0].find("ul")[0].find("a") -sharp
for a in list_a:
print(a)
print(a.attrs)
print(a.text)
-sharp pages = re.sub("\D", "", total_pages)
-sharp print(pages)
pass
if __name__ == "__main__":
stage_catch()
this is my corresponding node
<a href="http://www.dmzx.com/manhua/358/2000089062.html" title="360" target="_blank">
<span class="red">360</span>
(18)
</a>
<Element "a" href="http://www.dmzx.com/manhua/358/2000089062.html" title="360" target="_blank">
{"href": "http://www.dmzx.com/manhua/358/2000089062.html", "title": "360", "target": "_blank"}
(360) (18)
these are my three outputs. When I use a.text
to output, I am not
I want to call something like a.innerText
to get innerText
directly, that is, "(18 pages)", but there is no such method.
I temporarily converted to a string and then processed the corresponding string.
I want to know what I can do to test the corresponding methods in js for these python libraries.
I tried dir (a)
to get the method, and everything related to text tried once on the page and found that it didn"t work.