Currently working on a project, my goal is to create a scraper to check the availability of item with their respective sizes (stockId) with bs4
Website of interest: https://www.6pm.com/p/bogs-b-moc-mid-winter-painted-black-multi/product/9419937/color/80?zlfid=192&ref=pd_detail_1_sims_cv
I’m trying to extract the data from the “only # left in stock “ and the size inside the <input type:hidden class
.
So normally, a website will have out-of-stock on an item by default (if it’s out of stock). For this specific site, the user needs to select a shoe size before the target scrape “only # left in stock” if inventories are less than 10 for that specific size autherwise nothing is scrape .
What i have done :
value = soup.find('input', attrs={'name': 'stockId'}).get('value')
print(value)
Return error
My expected return is to get Each size and know “ only # left in stock “ respectively if applicable.
Said Traore is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1