I want to get the width percentage from the winter/spring/summer etc charts in this site: https://www.fragrantica.com/perfume/Christian-Dior/Sauvage-Eau-de-Parfum-48100.html
For example, for the winter season, I want to find this row in the page elements:
<div style="border-radius: 0.2rem; height: 0.3rem; background: rgb(120, 214, 240); width: 90.3491%; opacity: 1;"></div>
I have tried the following
res = requests.get("https://www.fragrantica.com/perfume/Christian-Dior/Sauvage-Eau-de-Parfum-
48100.html", headers={'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko),
Chrome/88.0.4324.150 Safari/537.36'}
soup = BeautifulSoup(res.content, 'html.parser')
winter_row = soup.select('div[style="rgb(120, 214, 240)"]')
print(winter_row)
I wanted to find that certain html row using the RGB that is unique for each season. The problem is I get an empty list as the output. I want my code to extract the width for each season, day and night from the charts so I know exactly what percentage the votes are.
Do you guys have any idea what should I do?
PS: I also got the name of the perfume from the site and it works, so I know I get a response.
name_row = soup.select('#toptop')[0]
name = name_row.getText().replace('\n', '')