Code
import requests
import os
from bs4 import BeautifulSoup
import pandas as pd
import time
with whiskynote.be data
Tony Duan
Name: beautifulsoup4
Version: 4.13.3
Summary: Screen-scraping library
Home-page: https://www.crummy.com/software/BeautifulSoup/bs4/
Author:
Author-email: Leonard Richardson <leonardr@segfault.org>
License: MIT License
Location: /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages
Requires: soupsieve, typing-extensions
Required-by: nbconvert
0
Web scraping on www.whiskynotes.be
<p><strong>Spheric Spirits</strong> is a young indie bottler from Germany, started by Benedict and Claudio. They have a slightly edgy / flashy branding (check <a href="https://sphericspirits.com/" rel="noopener" target="_blank">the website</a>) – I like the vibrant colours on the labels but apparently not everything agrees. Besides whisky, they’re also looking at armagnac and <em>destilado de agave</em>. They’re not just bottlers, by the way, they like to get involved at the beginning of production.</p>
[<h2 class="product-main__name">Blended Malt 44 yo 1978 (59,8%, Spheric Spirits 2023, refill sherry butt #6, 331 btl.)</h2>,
<h2 class="product-main__name">Springbank 27 yo 1994 (47,1%, Spheric Spirits 2022, refill sherry hogshead #95, 241 btl.)</h2>,
<h2 class="product-main__name">Islay Malt 25 yo (48,4%, Spheric Spirits 2022, 407 btl.)</h2>]
['Blended Malt 44 yo 1978 (59,8%, Spheric Spirits 2023, refill sherry butt #6, 331 btl.)',
'Springbank 27 yo 1994 (47,1%, Spheric Spirits 2022, refill sherry hogshead #95, 241 btl.)',
'Islay Malt 25 yo (48,4%, Spheric Spirits 2022, 407 btl.)']
---
title: "One page reveiw"
subtitle: "with whiskynote.be data"
author: "Tony Duan"
execute:
warning: false
error: false
format:
html:
toc: true
toc-location: right
code-fold: show
code-tools: true
number-sections: true
code-block-bg: true
code-block-border-left: "#31BAE9"
---
```{python}
import requests
import os
from bs4 import BeautifulSoup
import pandas as pd
import time
```
```{python}
os.system('pip show beautifulsoup4')
```
Web scraping on www.whiskynotes.be
# review page
{width="441"}
```{python}
review_url='https://www.whiskynotes.be/2024/ardbeg/spheric-spirits-springbank-blended-malt-islay-malt/'
```
# read in html
```{python}
# Send an HTTP GET request to the website
headers = {'User-Agent': 'My User Agent'}
response = requests.get(review_url,headers=headers)
```
```{python}
# success code - 200
print(response)
```
```{python}
#print(response.content)
```
```{python}
# Parse the HTML code using BeautifulSoup
soup = BeautifulSoup(response.content, 'html.parser')
```
```{python}
#print(soup.prettify())
```
```{python}
soup.title
```
```{python}
soup.p
```
```{python}
soup.find_all('.entry-content h2')
```
# take picture of url
# bottle_name
```{python}
bottle_name=soup.find_all('h2',class_="product-main__name")
bottle_name
```
```{python}
bottle_name2=[]
for i in bottle_name:
name=i.text
bottle_name2.append(name)
bottle_name2
```
# bottle_review
# bottle_review_Nose
# bottle_review_Mouth
# bottle_review_Finish
# first score
# all other score
# combine all score
# page_published_date
# page_class
# page_title
# combine all one_page_review
# output