想定位class为j_th_tit 的"a"标签,但是返回为空,是哪里写错了吗?万分感谢,代码和截图附上
from bs4 import BeautifulSoup
import urllib.request
from urllib.robotparser import RobotFileParser
from pyquery import PyQuery as pq
sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
html = '''
"<a rel="noreferrer" href="/p/6077550005" title="这一次" target="_blank" class="j_th_tit ">这一次</a>"
'''
bs = BeautifulSoup(html,"html.parser")
get_href_list = bs.find_all("a",class_="j_th_tit ")
print(get_href_list)
19行的函数第二个参数,把
j_th_tit
后面的空格去掉.