How does requests-html get the corresponding innerText?

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.

Mar.05,2021

if you have a jquery base, use the pyquery library


as far as I know, css selector can't get the last text directly.
simplify your code in addition.

the code I can think of is (get all a):

r=session.get('http://www.dmzx.com/manhua/358/')
a_ls=r.html.find('div.subsrbelist.center > ul > li > a')  

data=[]

for a in a_ls:
    chapter=' '.join(a.text.split(' ')[:-1])
    pages=a.text.split(' ')[-1]
    link=a.attrs['href']
    data.append({'chapter':chapter, 'pages':pages, 'link':link})

print(data)
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea895c-1eee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea895c-1eee.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?