I am trying to scrape data from a web page but I am not able to find all the chunks of data inside a container.
<div class="product-list-container" data-project-b="" data-mini-basket="on" data-chunk-caching-gutter="5" data-chunk-caching-delay="2" data-total-results="112" data-chunks-per-page="8" data-results-per-chunk="24" data-current-chunk="1" data-page-end-chunk="5" data-offset-chunk-threshold="12" data-findability-grid-position="on">
Inside the above container I have five chunks of data like the examples listed below:
<div class="product-list-container__chunk product-list-container__chunk--1" data-chunk="1" data-tagg-processed="true">
<div class="product-list-container__chunk product-list-container__chunk--2" data-chunk="2" style="" data-tagg-processed="true">
I am able to access first container with:
from bs4 import BeautifulSoup
import requests
soup = BeautifulSoup(page.content, 'html.parser')
d = soup.find('div', attrs={'product-list-container__chunk product-list-container__chunk--1'})
But if I try to do the same with the second container I am not able to access it, it seems like the parser is not getting all the information from the website or maybe I am not looking for it correctly.
from bs4 import BeautifulSoup
import requests
soup = BeautifulSoup(page.content, 'html.parser')
d = soup.find('div', attrs={'product-list-container__chunk product-list-container__chunk--2'})