I'm trying to scrape all information from archdaily over multiple pages of the website (e.g. from page 1 to 20).
The html structure looks like:
<div>
<div class = 'afd-container-main afd-container-main--margin-bottom nft-container-main-search clearfix afd-mobile-margin search-container'>
::before
<div>
<div class='gridview'>
<div>
<div data-insights-category>
<a href = '...'> # this is the htmls i wanted
The code I'm using is
soup = BeautifulSoup(html, 'html')
for foo in soup.find_all('div'):
bar = foo.find('div', attrs={'class': 'afd-container-main afd-container-main--margin-bottom nft-container-main-search clearfix afd-mobile-margin search-container'})
print(bar.text)
Error message
AttributeError: 'NoneType' object has no attribute 'text'
Am I misunderstanding something?