The problem of reading web page content by python

first of all, the source code of the web page (HTML) is as follows:

<span id="r_6f72ff900102xqgi" class="SG_txtb"></span>
The

page opens with the word "read 251", which means that the SPAN after the word" read "is the number of readings.

I use the PyQuery library to GET web page content. The code is as follows:

from pyquery import PyQuery as pq
 
d = pq(url="http://blog.sina.com.cn/s/blog_6f72ff900102xqgi.html")
print(d("span").filter("-sharpr_6f72ff900102xqgi") )

however, what is printed is not a number, but SPAN"s HTML:

.
<span id="r_6f72ff900102xqgi" class="SG_txtb"></span>

use PYTHON, for the first time to ask experienced friends for advice, thank you!

Feb.28,2021

get the text content using .text or .text ()

Menu