If i look can not find a
Can look at this test,see that i use Requests and not urllib.
So this will take out product info and price for the first graphics card.
class=fs-11
on that site.Can look at this test,see that i use Requests and not urllib.
So this will take out product info and price for the first graphics card.
import requests from bs4 import BeautifulSoup url = 'https://www.newegg.com/p/pl?d=graphicscard' headers = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36"} response = requests.get(url, headers=headers) soup = BeautifulSoup(response.content, 'lxml') prod_info = soup.select_one('div.item-info > a') print(prod_info.text) print('-' * 25) price = soup.select_one('ul > li.price-current') print(price.text)
Output:XFX Radeon RX 580 DirectX 12 RX-580P8DFD6 XXX Edition 8GB 256-Bit GDDR5 PCI Express 3.0 CrossFireX Support Video Card
-------------------------
$696.98 (4 Offers)–