I am creating a python scraper for a website to pull price, product number, cat number, description. When I run this script it only pulls the first item of the page then moves on to the next url. New to python just wondering how I can modify to pull all of the products from the page. Thanks to clarify the first url only has one product on it but the second the third all have many products that are not being pulled.
import requests
from bs4 import BeautifulSoup
import random
import time
product_urls = [
'https://www.qiagen.com/us/shop/pcr/primer-sets/miscript-precursor-assays/#orderinginformation',
'https://www.qiagen.com/us/shop/pcr/primer-sets/miscript-primer-assay-plate/#orderinginformation',
'https://www.qiagen.com/us/shop/pcr/primer-sets/miscript-primer-assays/#orderinginformation',
]
for URL in product_urls:
page = requests.get(URL)
soup = BeautifulSoup(page.text,"lxml")
timeDelay = random.randrange(5, 25)
for item in soup.select('.content'):
cat_name = item.select_one('.title').text.strip()
cat_discription = item.select_one('.copy').text.strip()
product_name = (item.find('div',{'class':'headline'}).text.strip())
product_discription = (item.find('div',{'class': 'copy'}).text.strip())
product_number = (item.find('td',{'class': 'textLeft paddingTopLess'}).text.strip())
cat_number = (item.find('td',{'class': 'textRight paddingTopLess2'}).text.strip())
product_price = (item.find('span',{'class': 'prc'}).text.strip())
print("Catagory Name: {}\n\nCatagory Discription: {}\n\nProduct Name: {}\n\nProduct Discription: {}\n\nProduct Number: {}\n\nCat No: {}\n\nPrice: {}\n\n".format(cat_name,cat_discription,product_name,product_discription,product_number,cat_number,product_price))
time.sleep(timeDelay)