In beautiful soup, how do I retrieve a nested element?
Below I am trying to retrieve the name of the product which is: LAP 13A 2-Gang SP Switched Socket + 3.1A 2-Outlet Type A USB Charger White
<h1 id="product_description" tabindex="0">
<span itemprop="name">
LAP 13A 2-Gang SP Switched Socket + 3.1A 2-Outlet Type A USB Charger White
</span>
<span class="sm" id="product_code_container">
(<span itemprop="productID">4087P</span>)
<meta itemprop="sku" content="4087P">
</span>
</h1>
I have tried the code below but doesn't return any product names, just blank:
soup = bs(page.content, 'html.parser')
product_title = soup.find('h1',attrs={'id':'product_description'}).find('span', attrs={'itemprop':'name'})
products.append(product_title.text)