无法从图像中提取文本 link

Cannot WebScrape text from image link

我无法从亚马逊产品页面上抓取评分百分比。我只得到空值。这是我的代码

from typing import Text
from bs4 import BeautifulSoup
import requests
import pandas as pd
from datetime import date
import os

url='https://www.amazon.in/dp/B09BJQCTMX?ref=myi_title_dp'
req = requests.get(url)
content=BeautifulSoup(req.content,"lxml")
data = content.findAll('a',class_='a-link-normal')
print(data)

我提供了正确的 class 名称,但检索到的只有空值。

尝试将 headers 放入请求调用中,数据将出现在 content

headers={"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36"}
url='https://www.amazon.in/dp/B09BJQCTMX?ref=myi_title_dp'
req = requests.get(url,headers=headers)
content=BeautifulSoup(req.content,"lxml")

现在使用适当的class查找数据

text_data=content.find("span",class_="a-list-item").get_text(strip=True)
href_data=content.find("span",class_="a-list-item").find("a")['href']

图片: