I would like to get all hrefs which are within these li's in this ul: Click here to see screenshot
So far I wrote this line:
import bs4, requests, re
product_pages = []
def get_product_pages(openurl):
global product_pages
url = 'https://www.ah.nl/producten/aardappel-groente-fruit'
res = requests.get(url)
soup = bs4.BeautifulSoup(res.text, 'html.parser')
for li in soup.findAll('li', attrs={'class': 'taxonomy-sub-selector_root__3rtWx'}):
for a in li.findAll('a', href=True):
print(a.attrs['href'])
get_product_pages('')
But it is only giving me the hrefs from the first three li's. I am wondering why it is only the first three and I am wondering how to get all eight..
In the page there is a scroll bar, which might cause trouble?