Не могу спарсить несколько полей на сайте
https://samara.leroymerlin.ru/product/molotok-slesarnyy-dexter-27-mm-81968476/
Интересуют поля в блоке "Наличие в магазинах":
название магазина 1 - количество
название магазина 2 - количество
название магазина 3 - количество
import requests
import fake_useragent
from bs4 import BeautifulSoup
FIND_URL = r'https://samara.leroymerlin.ru/product/molotok-kovanyy-kedr-300-g-1-6-60-055-0300-93834892/'
FAKE_USER = fake_useragent.FakeUserAgent().random
HEADERS = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"User-Agent": FAKE_USER
}
def get_html(url):
r = requests.get(url, headers=HEADERS)
if r.status_code == 200:
return r
else:
print("wrong request")
def get_content(url):
r = get_html(url)
soup = BeautifulSoup(r.content, 'lxml')
# article = soup.find('div', 'product-info-container')
article = soup.find('span', {'slot': 'article'}).get_text().strip().split()[1]
print("Артикл:", article)
name = soup.find('h1', {'slot': 'title'}).get_text().strip()
print("Наименование:", name)
price = soup.find('span', {'slot': 'price'}).get_text().strip()
print("Цена:", price)
#stock
# выдает пустой список
block_stock = soup.select('.stock-list-content > uc-store-stock:nth-child(1)')
# и так тоже выдает пустой список
block_stock =soup.find('div', 'stocks-list-slot-container')
print(block_stock)
if __name__ == "__main__":
get_content(FIND_URL)
Кому не сложно обьясните как сделать?