I'm scraping a website, but some products don't appear in the DOM unless you scroll down. For instance take a look at this page.
When I store the DOM inside a variable and try to get the divs corresponding to the products:
req = requests.get(*url*,verify=False)
soup = BeautifulSoup(req.text,'html.parser')
product_list = soup.findAll("div",class_="product-block")
product_list only contains 24 elements (instead of 91, the number of products in that page if you scroll down completely).
How can I store the complete DOM inside req
?
NB.
I'm not sure if that is the reason for the products non appearing in product_list, but this is the interpretation I give since, when I inspect the DOM with firefox, if I don't scroll down, I only see 24 <div class="product-block ...">
, not 91.