Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon Webscraping issue #33

Open
alladapraveen1 opened this issue Jul 19, 2024 · 2 comments
Open

Amazon Webscraping issue #33

alladapraveen1 opened this issue Jul 19, 2024 · 2 comments

Comments

@alladapraveen1
Copy link

Hi Alex,
My Name is Praveen Kumar, I was following your data Analyst Boot Camp. I was at closer to complete the course. but i'm at Amazon Webscraping Module I was getting error to get Price from Amazon. Iwas sharing the screen short of this. Even I tried the code you uploaded in github and i'm getting same error .Please Help to resolve

`
from bs4 import BeautifulSoup
import requests
import time
import datetime

import smtplib

URL = 'https://www.amazon.com/Funny-Data-Systems-Business-Analyst/dp/B07FNW9FGJ/ref=sr_1_3?dchild=1&keywords=data%2Banalyst%2Btshirt&qid=1626655184&sr=8-3&customId=B0752XJYNL&th=1'

headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36", "Accept-Encoding":"gzip, deflate", "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8", "DNT":"1","Connection":"close", "Upgrade-Insecure-Requests":"1"}

page = requests.get(URL, headers=headers)

soup1 = BeautifulSoup(page.content, "html.parser")

soup2 = BeautifulSoup(soup1.prettify(), "html.parser")

title = soup2.find(id='productTitle').get_text()
print(title)
price = soup2.find(id='priceblock_ourprice').get_text()
print(price)

`
image

@arodriguezb52
Copy link

I'm getting this exact same error and I have run it through pretty much all the AIs and they don't see any difference between the code that Alex is using and the one I have; yet mine is not working because of an AttributeError.

@zijzhang
Copy link

@alladapraveen1 @arodriguezb52 I have the same issue. I found that the requests seem not working for amazon webs. The page returned is no as the URL. I'm trying the selenium to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants