Trying to web scrape the Product count from this page https://www.digikey.com/en/products/filter/dc-dc-converters/922?s=N4IgjCBcpgnAHLKoDGUBmBDANgZwKYA0IA9lANogAMIAusQA4AuUIAykwE4CWAdgOYgAvkOIBWZCAZQwjaZDBUqIoA
My current code is:
from bs4 import BeautifulSoup
import time
url= 'https://www.digikey.com/en/products/filter/dc-dc-converters/922?s=N4IgjCBcpgnAHLKoDGUBmBDANgZwKYA0IA9lANogAMIAusQA4AuUIAykwE4CWAdgOYgAvkOIBWZCAZQwjaZDBUqIoA'
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
time.sleep(10)
content = soup.find('span', attrs={'data-testid': 'static-product-count'})
print(content.text)
The html part is
<span data-testid="static-product-count" class="jss68">248,154 </span>
My code is returning a null output however, the same code would work fine a few weeks back when the html part was (but im wondering how that makes a difference? can someone help explain?) thanks!
<span class="jss82" data-testid="product-count">1604</span>