From 035ccb2e2bc6c7fe1b889780ce7e31449e531a8c Mon Sep 17 00:00:00 2001 From: Mahrukh <66876079+mahrukhS@users.noreply.github.com> Date: Tue, 7 Nov 2023 20:08:08 +0500 Subject: [PATCH] fetch price using "a-price", "a-offscreen" --- Amazon Web Scraper Project.ipynb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Amazon Web Scraper Project.ipynb b/Amazon Web Scraper Project.ipynb index 7a317cf..b190c0e 100644 --- a/Amazon Web Scraper Project.ipynb +++ b/Amazon Web Scraper Project.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "f236cbb9", "metadata": {}, "outputs": [], @@ -19,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "9b531b61", "metadata": {}, "outputs": [ @@ -51,13 +51,14 @@ "\n", "title = soup2.find(id='productTitle').get_text()\n", "\n", - "price = soup2.find(id='priceblock_ourprice').get_text()\n", + "#price = soup2.find(id='priceblock_ourprice').get_text()\n", "\n", + "price_tag = soup2.find(class_=\"a-price\")\n", + "price = price_tag.find(class_=\"a-offscreen\").get_text()\n", "\n", - "print(title)\n", - "print(price)\n", "\n", - "\n" + "print(title)\n", + "print(price)\n" ] }, {