I'm really new to this and am confused on how I can select information with a particular div class image of html but it is <div class="row" data-start="1.."). I don't understand what data-start is considered within the and how I can get the pricing information from that table, it just keeps showing me none as an output. Any help would be much appreciated.
here is my code:
from bs4 import BeautifulSoup
import bs4
import requests
import json
import numpy as np
urls = ['https://filterbuy.com/brand/trion-air-bear-air-filters/20x20x5-air-bear-20x20/?selected_merv=8',
'https://filterbuy.com/brand/trion-air-bear-air-filters/20x20x5-air-bear-20x20/?selected_merv=11',
'https://filterbuy.com/brand/trion-air-bear-air-filters/20x20x5-air-bear-20x20/?selected_merv=13']
#scrape elements
for url in urls:
response = requests.get(url)
soup = BeautifulSoup(response.content, "html.parser")
#returned values
product = soup.find("h1", class_="text-center")
merv = url.rsplit('?', 0)
price_table= soup.find("??????")
json_schema = soup.find_all('script', attrs={'type': 'application/ld+json'})[1]
json_file = json.loads(json_schema.get_text())
for product, merv, in zip(product, merv):
print(product.getText(), merv, price_table, json_file)
np.savetxt('products.csv', [p for p in zip(product, json_schema)], delimiter=',', fmt='%s')