Untitled

 avatar
unknown
plain_text
2 years ago
488 B
4
Indexable
import requests
from bs4 import BeautifulSoup

url = 'https://recordstoreday.com/UPC/602557945874/Lorde_Melodrama-Limited-Edition-Deluxe-LP'

response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')

stores = soup.find_all('div', {'class': 'store'})

for store in stores:
    store_name = store.find('h4').text
    availability = store.find('div', {'class': 'stock'}).text
    if 'In Stock' in availability:
        print(store_name + ' has the item in stock.')
Editor is loading...