https://campervans.jeanlain.com/locatio ... nnecy&city -name=ANNECY&departure_date=06%2F01%2F2025&departure_time=11%3A00&return_date=10%2F01%2F2025&return_time=10%3A00
Я пробовал с запросами и запросами -html, но ни один из них не работает...
Вот мой код:
Код: Выделить всё
from requests_html import HTMLSession
session = HTMLSession()
from bs4 import BeautifulSoup
response = session.get('https://campervans.jeanlain.com/locations/?city-input=annecy&city-name=ANNECY&departure_date=06%2F01%2F2025&departure_time=11%3A00&return_date=10%2F01%2F2025&return_time=10%3A00')
response.html.render()
soup = BeautifulSoup(response.html.html, 'html.parser')
products = soup.find_all('section', class_='product')
for product in products:
title = product.find('h2', class_='woocommerce-loop-product__title')
if title:
print(title.text)
price_info = product.find('div', class_='content-right')
if price_info:
price = price_info.find('p', class_='price')
print(price)
else:
print("content-right not found")
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/786 ... quets-html