请教python3爬取没数字的星级?

请教:
星级的源码是这样的,如何用python3爬取星级呢?
在这里插入图片描述
初学者,求大佬们赐教o(╥﹏╥)o
其他的书名和价格都可以拿到,就是这个星级不知道咋办

import requests
from bs4 import BeautifulSoup
res=requests.get('http://books.toscrape.com/catalogue/category/books/travel_2/index.html')
html=res.text
book=BeautifulSoup(html,'html.parser')
items=book.find_all(class_="product_pod")
for item in items:
    name=item.find('h3')
    rate=item.find(class_="star-rating")
    price=item.find(class_="price_color")
    print(name.text,'\n',rate.text,'\n',price.text)

猜你喜欢

转载自blog.csdn.net/bool_worm/article/details/88396938