Вам потребуется селен, чтобы получить точные значения, отображаемые на странице, поскольку данные этой страницы заполняются динамически, используя Javascript
из JSON
.
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_argument("--headless")
driver = webdriver.Chrome(executable_path=r"***YOUR_CHROME-DRIVER_PATH***", chrome_options=chrome_options)
driver.get('https://www.priceline.com/m/fly/search/YYZ-YUL-20200214/?cabin-class=ECO&no-date-search=false&search-type=11&num-adults=1&refclickid=https%3A%2F%2Fwww.google.com%2F')
soup = BeautifulSoup(driver.page_source, 'lxml')
price = soup.find_all('span', {'data-test': 'rounded-dollars'})
for price in prices: print(price.text, end=' | ')
Вывод:
112 | 112 | 112 | 112 | 112 | 112