I'm trying to use python to webscrap information from a car website to have name & price. but the output is empty lists
car website: https://www.contactcars.com/en/cars/used/toyota?page=1&sortOrder=false&sortBy=CreatedAt
my code:
import pandas as pd
import requests
from bs4 import BeautifulSoup
web_page = requests.get("https://www.contactcars.com/en/cars/used/toyota?page=1&sortOrder=false&sortBy=CreatedAt").text
soup = BeautifulSoup(web_page)
data = []
for x in soup:
name = soup.find_all('div', attrs={'class':'n-engine-card__model ng-star-inserted'})
price= soup.find_all('div', attrs={'class':'n-engine-card__price'})
data.append({
'name':name,
'price':price
})
print(data)
output:
[{'name': [], 'price': []}, {'name': [], 'price': []}]
soup.find_alland check if it produces any output.scriptblock whitid="serverApp-state"