Amazon Web Scraping Using Python | Data Analyst Portfolio Project

Поділитися
Вставка
  • Опубліковано 7 вер 2024
  • Take my Full Python Course Here: bit.ly/48O581R
    Web Scraping isn't just for those fancy "programmers" and "software developers". Us analysts can use it too! In this project I walk through how to scrape data from Amazon using BeautifulSoup and Requests.
    LINKS:
    Code in GitHub: github.com/Ale...
    Anaconda: www.anaconda.c...
    Find Your User-Agent: httpbin.org/get
    ____________________________________________
    SUBSCRIBE!
    Do you want to become a Data Analyst? That's what this channel is all about! My goal is to help you learn everything you need in order to start your career or even switch your career into Data Analytics. Be sure to subscribe to not miss out on any content!
    ____________________________________________
    RESOURCES:
    Coursera Courses:
    Google Data Analyst Certification: coursera.pxf.i...
    Data Analysis with Python - coursera.pxf.i...
    IBM Data Analysis Specialization - coursera.pxf.i...
    Tableau Data Visualization - coursera.pxf.i...
    Udemy Courses:
    Python for Data Analysis and Visualization- bit.ly/3hhX4LX
    Statistics for Data Science - bit.ly/37jqDbq
    SQL for Data Analysts (SSMS) - bit.ly/3fkqEij
    Tableau A-Z - bit.ly/385lYvN
    Please note I may earn a small commission for any purchase through these links - Thanks for supporting the channel!
    ____________________________________________
    SUPPORT MY CHANNEL - PATREON/MERCH
    Patreon Page - / alextheanalyst
    Alex The Analyst Shop - teespring.com/...
    ____________________________________________
    Websites:
    GitHub: github.com/Ale...
    ____________________________________________
    All opinions or statements in this video are my own and do not reflect the opinion of the company I work for or have ever worked for

КОМЕНТАРІ • 638

  • @BummerSlug
    @BummerSlug 3 роки тому +251

    The real talk is nice. “It took ten hours over two weeks”. These are things people need to hear. Some people watch these videos on YT and think it is just that easy. This is why your channel is on my short list of channels I subscribed to. Thanks for all your time on these.
    Hey MS Excel - sponsor this channel!

    • @AlexTheAnalyst
      @AlexTheAnalyst  3 роки тому +54

      I try to make it as realistic as possible - I used to think people could do this all off the top of their heads and I would get discouraged. Glad to hear that! :D

    • @pkabir4625
      @pkabir4625 Рік тому

      @@AlexTheAnalyst For the same product, I couldn't find the id for price...it shows div class...what to do?

    • @ayoni02
      @ayoni02 Рік тому

      This should work if you tweak it well enough

    • @samosagaming9476
      @samosagaming9476 Рік тому +2

      @@pkabir4625 go little bit up you will find id but you have to use strip function and [1:4] or insert the values as per your requirement to get the exact vales. this worked for me

    • @kuldeeprana7659
      @kuldeeprana7659 Рік тому

      it didnot work for me , not showing price id ,its in span tag

  • @kishwaralamgir4468
    @kishwaralamgir4468 Рік тому +64

    Alex is so honest and down to earth, he doesnt have that usual UA-camr vibe that we are accustomed to. Man we're so lucky to find you as a mentor.

    • @AlexTheAnalyst
      @AlexTheAnalyst  Рік тому +13

      That means a lot! Thanks for watching! :D

    • @pulakkabir2276
      @pulakkabir2276 Рік тому

      @@AlexTheAnalyst hi. how to find the code you showed right of the 't-shirt' web page?..you selected price...then the code for price got selected. how to do that?

    • @mulikinatisiddarthasiddu8245
      @mulikinatisiddarthasiddu8245 14 днів тому

      ​@@pulakkabir2276 right click and click in inspect or use ctrl+shift+i

  • @atanasprodatanasov9233
    @atanasprodatanasov9233 2 роки тому +16

    The section where you speak about how you shouldn't know this by heart is so good. Honestly... I am learning SQL as per your recommendation, but in the back of my head I am scared as I think I should learn and memorize each single block of code... And this is awful... Thank you for being honest and clear on that!

  • @nevinphilbert
    @nevinphilbert 6 місяців тому +9

    man i've been battling with the bot blocker from amazon and also some scraping issues with price because the website display was changed a while after this video was uploaded, but I've managed to pull it off so i hope this might help those recent viewers who might be as confused as me when I started writing this code on my own.
    apparently you need to divide the second cell so you need to run the soup1 first before you run the soup2, then for the price you need to pull three part of span class=a-price-symbol, span class=a-price-whole, and span class=a-price-fraction and combine it together into 1 new variable (price), then you need to clean it using strip() and replace() to clean the whitespaces and
    's.
    hope this helps!

    • @deeplakshmiyadav
      @deeplakshmiyadav 6 місяців тому +1

      Brother please elaborate it, I am stuck

    • @ritiknegi8596
      @ritiknegi8596 5 місяців тому +1

      Hey bro can you explain it or can you share your code, how you pulled three part together. I am stuck in this part

    • @sdivi6881
      @sdivi6881 5 місяців тому +1

      Could you please explain it, I am stuck in getting Title itself

    • @ritiknegi8596
      @ritiknegi8596 5 місяців тому

      @@sdivi6881 Hey i just solved it can you tell little more where you are getting stuck

    • @ShortClipsPodcasts
      @ShortClipsPodcasts 5 місяців тому

      @@deeplakshmiyadav
      price_symbol = soup2.find(class_='a-price-symbol').get_text(strip=True)
      price_whole = soup2.find(class_='a-price-whole').get_text(strip=True)
      price_fraction = soup2.find(class_='a-price-fraction').get_text(strip=True)
      price = f'{price_symbol}{price_whole}{price_fraction}'
      print(price)

  • @abdouelkafrawy1726
    @abdouelkafrawy1726 Рік тому +11

    it's been a year on this project and despite me searching and watching other channels, I always come back to your channel ,you are simple the best person I have learned from . you are genuine and always able to get your point across .I hope you expand your "python for data analysis" series just like you did with SQL.
    Thank you so so much .

  • @newyork397
    @newyork397 2 роки тому +12

    As others described, if you get an error when running the second cell it's probably due to a captcha issue where amazon thinks you are a bot. You can force it by pressing ctrl + enter again and again until you get an output. I'm sure there is a better way to get around this but that's the quickest semi solution I found.

    • @newyork397
      @newyork397 2 роки тому +4

      The while loop definitely doesn't work now that Amazon updated their website with some sort of blocker for bots. It might work a few times but eventually stops running in background.

  • @enestemel9490
    @enestemel9490 3 роки тому +23

    Hey Alex quick tip: When you were working on spaces like 34:21 if you select everything that you wanna move and press tab this way everything you choose goes 1 tab right. Little things like that improve your quality of life sometimes. Thanks for the tutorial :)

  • @amelieguzman9639
    @amelieguzman9639 Рік тому +5

    You don't imagine how this tutorial has helped me in my new position. Thank you so much!!

    • @AlexTheAnalyst
      @AlexTheAnalyst  Рік тому

      So glad it was helpful! :D

    • @adisonfryman144
      @adisonfryman144 Рік тому

      @@AlexTheAnalyst Did you ever make the second one? So many people want to see it? Please do send it out!

  • @krystlestevens2585
    @krystlestevens2585 Рік тому +37

    Unfortunately it no longer works (due to Amazon website update I believe, as others have commented) :/ would love another scraping video so I can learn!! Love all the videos Alex and thanks so much!😊

    • @krystlestevens2585
      @krystlestevens2585 Рік тому +1

      @@nezzylearns happy to help

    • @VishalSharmaOfficialVS
      @VishalSharmaOfficialVS Рік тому +2

      Were you able to bypass the Amazon scraping detection? I am also receining NoneType error.

    • @krystlestevens2585
      @krystlestevens2585 Рік тому +1

      @@VishalSharmaOfficialVS I unfortunately wasn't able to figure it out :/ This is one of the harder projects (to me) so I was going to circle back after going through the rest of Alex's projects. If you figure out how to bypass it plz comment here with an update!

    • @VishalSharmaOfficialVS
      @VishalSharmaOfficialVS Рік тому +4

      @@krystlestevens2585 sure! I’m working on it. As soon as I have a concrete solution, I will post it here. Thanks for your reply.

    • @adisonfryman144
      @adisonfryman144 Рік тому

      @@VishalSharmaOfficialVS did you ever figure this out?

  • @user-gq1ij
    @user-gq1ij 2 роки тому +4

    Sir, I am very near to get my first job through your project
    Thank you
    And this is also my first project

  • @DustInTheAir
    @DustInTheAir 2 роки тому +4

    Hey Alex! Thanks for this helpful video! The best part of this video is whenever you said 'I don't know what that is' (12:50) , instead of some difficult theory. You don't know that, I don't know neither, so it makes me feel less pressure on learning python...

  • @skugga7
    @skugga7 5 місяців тому +1

    This project gave me a taste of how challenging web scraping is. Great video that makes things look easy and less intimidating.

  • @podawe8051
    @podawe8051 3 роки тому +11

    So great Alex! I followed along with this entire project and added it to my portfolio! I'll be sure to give you credit in my README file. :)

  • @shyamss2338
    @shyamss2338 2 роки тому +30

    Hi Alex, seems like this code is now not working. Would be grateful if you could do another web scraping project with EDA analysis?
    Love how instructive your videos are.

  • @pfguo87
    @pfguo87 Рік тому +22

    By any chance was there a part 2 to this with the more advance scraping? Would love to see that :)

    • @kyleluckritz2077
      @kyleluckritz2077 Рік тому +4

      Looking for the part 2 you mentioned in the vid!! Thanks

  • @sj1795
    @sj1795 8 місяців тому +1

    Hi Alex, I really appreciate how you shared how long this project actually took you. It helps to know the difference between what we go through on your channel and the work/time it actually takes behind the scenes. AWESOME project! I learned tons and found all of it very useful/helpful. You are such an AMAZING teacher and resource! As always, THANK YOU!!

    • @valadhruv6920
      @valadhruv6920 6 місяців тому

      Bro did you got nonetype error and how you solved it?

    • @abdelrahmanmalekgenedy8751
      @abdelrahmanmalekgenedy8751 6 місяців тому

      I have this error bro, and don't how to solve it
      @@valadhruv6920

    • @pradeep1900
      @pradeep1900 Місяць тому

      @@valadhruv6920 bro, did u found the solution for this? i can't figure it out

  • @yousseftaki1949
    @yousseftaki1949 2 роки тому +2

    What attracted me from your video hh is that you have 3 kids , this is a great man
    God bless your family

  • @reshuraj5005
    @reshuraj5005 Рік тому +4

    you're already doing a great job man. Thanks a ton, and hats off to you.
    But,
    We need that part 2. Please do it asap Alex.

  • @jeisonsanchez4842
    @jeisonsanchez4842 2 роки тому +2

    29:30 - quick tip: select the file, hold shift and right-click to get “copy as path” in the context menu.

  • @ShortClipsPodcasts
    @ShortClipsPodcasts 5 місяців тому +13

    anyone stuck trying to get the price.
    price_symbol = soup2.find(class_='a-price-symbol').get_text(strip=True)
    price_whole = soup2.find(class_='a-price-whole').get_text(strip=True)
    price_fraction = soup2.find(class_='a-price-fraction').get_text(strip=True)
    price = f'{price_symbol}{price_whole}{price_fraction}'
    print(price)

    • @tranguyen4462
      @tranguyen4462 5 місяців тому +1

      Hi. I am not even able to print(soup1) due to some sort of anti bot blocking from Amazon. do you have any idea how to solve that? Thank you

    • @Angel-bn1yo
      @Angel-bn1yo 5 місяців тому

      Thank you!

    • @justinwelsh7376
      @justinwelsh7376 3 місяці тому

      Thank you man, I realized something was different with the html but lack the coding skills to fix it in a timely manner.

    • @dragusinsilviu4862
      @dragusinsilviu4862 3 місяці тому

      thumbs up, i've spend too much time looking for this comment, @Alex can you include that in the bio?

    • @onitolu9698
      @onitolu9698 Місяць тому

      Thank you so much for this

  • @nezerm2363
    @nezerm2363 3 місяці тому +11

    "AttributeError: 'NoneType' object has no attribute 'get_text'" to solve this
    delete headers

    • @shubhamjha2017
      @shubhamjha2017 Місяць тому

      still showing the same error

    • @Kshitij-Rajkumar-Yadav
      @Kshitij-Rajkumar-Yadav 18 днів тому

      It worked

    • @mulikinatisiddarthasiddu8245
      @mulikinatisiddarthasiddu8245 14 днів тому

      ​@@Kshitij-Rajkumar-Yadav can you elaborate it bro

    • @Kshitij-Rajkumar-Yadav
      @Kshitij-Rajkumar-Yadav 14 днів тому

      @@mulikinatisiddarthasiddu8245
      sure man
      If u get the above error
      Go to the place where u entered the URL
      Then headers
      delete the header
      So it'll be
      URL
      page = request.get(url)
      Soup1
      This should fix it
      If u have any other issues lemme know I just finished this code so I went through everything I'll share it

    • @akshaybohra855
      @akshaybohra855 7 днів тому

      @@mulikinatisiddarthasiddu8245 price_symbol = soup2.find(class_='a-price-symbol').get_text(strip=True)
      price_whole = soup2.find(class_='a-price-whole').get_text(strip=True)
      price_fraction = soup2.find(class_='a-price-fraction').get_text(strip=True)
      price = f'{price_symbol}{price_whole}{price_fraction}'
      try this it will work if you are getting the error to get the price

  • @patcharaphanjearsavaswatta6149

    Thank you for this, Alex. I felt so happy when I finally could scrap the website I had been trying to scrap (I applied your teaching to another website). Really appreciate your work.

  • @pushpitjain7208
    @pushpitjain7208 2 роки тому +6

    Hey Alex! It was a super helpful video. Thank you so much for posting it. Have you uploaded the next part of this video. If yes, Please share the link.

  • @simoyland
    @simoyland 11 місяців тому +1

    Always thank you for all your efforts and good work! I love watching your videos. Your positive attitude and way of expression make the lesson even more fun. I've seen a few people say the video is too long, but I think being able to walk through the lesson together rather than other videos that show written code is much better for learning. Thank you thank you thank you ☺

  • @patientson
    @patientson 8 днів тому +1

    You have been consuming alot of sugary, oily and salty meals in spring and summer when you embarked on this project. I have a living remedy for you. The treatment to what is causing you to clear your throat is lack of longsuffering walks and eating the right food at the wrong time and season, coupled with nothing doing the right thing with food in their seasons. In the world right now, only a handful of people know this knowledge and they are definitely not Europeans nor Americans.

  • @lawrencelawliet5016
    @lawrencelawliet5016 2 роки тому +5

    If anyone else has a problem like I did with getting a captcha output when printing soup2, I solved it by putting soup2 and the print statement in a different cell then run the first cell with soup1 then run the second cell with soup2 and the print statement separately.

  • @hafsahshazmeen1446
    @hafsahshazmeen1446 Рік тому +1

    This man a God send gift to ALL the Broke data analyst students

  • @RyanLoh
    @RyanLoh 2 роки тому +6

    When I try to print the title im getting an error message "'NoneType' object has no attribute 'get_text''. What is the issue here?

  • @esonon5210
    @esonon5210 3 роки тому +4

    Thanks for sharing! This is an awesome video. I'm not sure if you did this but I think it would be cool to learn how to scrape multiple pages then append the data in a def function.

  • @horacezhen
    @horacezhen 3 роки тому +6

    Thank you for demonstrating! I never thought that a simple project like this could use as a portfolio project. I just realized that I have what it takes to become a DA. Thank you for demonstrating projects!

  • @patrickbarchok7741
    @patrickbarchok7741 3 роки тому +18

    I am so grateful for finding you. Almost feels like I know you personally. I'm still very new to this whole Data Analytics but I'm learning a lot.
    A quick question: I'm on the Google analytics course by coursera and the language is R. Any ideas on where I can learn python- preferably in a structured way that is beginner friendly?
    Again thank you for the work. Truly amazing.

    • @AlexTheAnalyst
      @AlexTheAnalyst  3 роки тому +7

      I’m so glad to hear that! I honestly will ups do some UA-cam to just get the hang of it - then I would check out my Udemy Course recommendations in the description below - those are ones I’ve taken and loved. That would be my next step. Thanks for watching! 😁

    • @danramirz
      @danramirz 3 роки тому +2

      Very nice 👍 that be good for checking the prices on udemy courses. 😅

    • @reneepaz8077
      @reneepaz8077 3 роки тому +1

      I am also taking the Google Analytics course, one question that I would like to ask is, how do you know or prevent bias from the data being collected?

    • @nickmoritz1515
      @nickmoritz1515 2 роки тому +1

      One thing I'd like to point out here is you can easily switch from R to Python. There are plenty of courses out there like Alex had mentioned but the key take away from the course which I did finish and landed a data analysis job, is make sure when following Alex watch how he uses 'pandas' and other packages, which is essentially the same as the tidy-verse in R. Look at the packages and how he writes the code. I think that will help you out the most on top of taking courses.

    • @ermano5586
      @ermano5586 Рік тому

      @@nickmoritz1515 Hey man! How is it going? Can you share some tips that helped you to land a Data Analyst job, maybe there is additional stuff, I've almost finished Alex's data analyst bootcamp and pre-graduate cource bachelor student. I would be grateful for sharing, please?

  • @shawonalam6780
    @shawonalam6780 24 дні тому +2

    16:30 Solution to get the price:
    price_symbol = soup2.find(class_='a-price-symbol').get_text(strip=True)
    price_whole = soup2.find(class_='a-price-whole').get_text(strip=True)
    price_fraction = soup2.find(class_='a-price-fraction').get_text(strip=True)
    price = f'{price_symbol}{price_whole}{price_fraction}'
    print(price)

  • @sunyoungjang7810
    @sunyoungjang7810 2 роки тому +2

    I'd like to appreciate you for sharing this wonderful video! Thanks to you, I've just managed to make my own webscraper that helps me to save so much time. Otherwise, my coworker and I would have to spend more than 6hours per week😂

  • @tharindusamarakoon8831
    @tharindusamarakoon8831 3 роки тому +4

    Can you please make a video on how to present these projects? I've seen your video about the portfolio website, but I don't have an idea on how to actually present the github..
    And thank you very much. Your channel has been very inspirational to me through out my learning journey!

    • @AlexTheAnalyst
      @AlexTheAnalyst  3 роки тому +2

      Good idea!

    • @tharindusamarakoon8831
      @tharindusamarakoon8831 3 роки тому

      @@AlexTheAnalyst Hi Alex, to further add to my comment - I've taken a look at other "best example" portfolios online but comparing it to the Google data analytics portfolio guidelines, they are very different. Hence my conflict and lack of general understanding on how to present these projects in a website.
      Thank you.

  • @kevindeschepper8140
    @kevindeschepper8140 2 місяці тому +1

    if you dont pull in the data due to the captcha, dont use the headers as second argument.

  • @anthonyyawa2445
    @anthonyyawa2445 Рік тому +3

    Great video alex ... it was really helpful for a module in my course . Please i have been looking for the intermediate video you spoke about

  • @andreymoroz8204
    @andreymoroz8204 Рік тому +2

    Hello Alex!
    One more step is done!!! It's so exciting, I got stuck at the stage where I had to get price data. I missed this metric to be scraped. Since the time you recorded this video some parts of html have been updated. So now price does not exist in the format of "ID=", it lives now as "div class=". So now it is challenging for to find out how to scrap the price though :))) will go deeper to the topic. Thanks much for your time and for sharing of your knowledge.

  • @kendrasdustyroad
    @kendrasdustyroad Рік тому +3

    Dude! I'm an amazon seller and this kind of work would come in super handy. Thank you. Did you ever get around to making the next video where you pull data from all the search results page? I'd be really interested to see that one.

  • @user-vy8kk9ob3s
    @user-vy8kk9ob3s 4 місяці тому

    Hi Alex, I have learn a lot from 65 videos of the Bootcamp. God bless with everything. Thanks!!!

  • @Kaura_Victor
    @Kaura_Victor 2 місяці тому

    Though the project was quite tricky, I got over it.
    Thank you so much Alex.

  • @abhinandc5018
    @abhinandc5018 3 роки тому +7

    The long awaited one ❤️💯

  • @Jj-th8vl
    @Jj-th8vl 10 місяців тому +6

    Hey Alex, first I want to thank you for this amazing series and everything you do to help the community.
    Second, I am working on this project and it seems Amazon implemented a CAPTCHA to prevent scrapping. Is there any way around this? Would love to know if this project is applicable and doable even 2 years later. Cheers!

    • @ChristinaRichardsonFitness
      @ChristinaRichardsonFitness 9 місяців тому

      Yeah. I have been trying for 2 hours to get into Amazon. I think it is a bit more difficult now. Were you able to find a way?

    • @shriyakenkre1474
      @shriyakenkre1474 8 місяців тому

      Having the same problem.

    • @MindOfAlpo
      @MindOfAlpo 7 місяців тому

      Yeah, same here. There are ways to bypass but it looks like it might be borderline unethical. Zenscrape, Apify, or ScraperAPI give you the ability to fetch the data directly from the API instead of the HTML page(beautiful soup).

    • @abdallahibrahim3864
      @abdallahibrahim3864 7 місяців тому +1

      if you are running into an issue with the header, try this:
      headers = {"User-Agent": ".......", "Accept-Encoding": ".....", "Accept": "......" }
      just put in whatever you get from the User-Agent link in the video description

  • @asutoshnayak1391
    @asutoshnayak1391 3 роки тому +2

    Alex please make a video upon how to create your own Data set for data analyst job ? Please make

  • @sunrajsharma736
    @sunrajsharma736 Рік тому +2

    It was a fun project. Please drop the other version (the complete version) of this project @Alex The Analyst

  • @ayubindra3702
    @ayubindra3702 2 роки тому +12

    Hello Alex, thanks for sharing, I have found the error for my code of this section
    title = soup2.find(id='productTitle').get_text()
    print(title)
    output:
    'NoneType' object has no attribute 'get_text'
    Please I need your advise

    • @gorand8842
      @gorand8842 2 роки тому

      same here

    • @cocojamborambo5435
      @cocojamborambo5435 Рік тому +6

      Hello!
      You can do this:
      page = requests.get(url,headers=headers)
      soup= BeautifulSoup(page.content, "html.parser")
      and then get your data:
      title = soup.find(id='productTitle').get_text().strip()
      price = soup.find('span',class_='a-offscreen').get_text().replace("$","")
      You don't need prettify anymore as your computer can easely read that

    • @janinepino5291
      @janinepino5291 Рік тому +1

      @@cocojamborambo5435 Weirdly enough, this works for one moment, and then it stops when I run it again.

    • @anonymous-3720
      @anonymous-3720 Рік тому

      Same.

    • @barkamolurinboev6311
      @barkamolurinboev6311 Рік тому

      You edit to headers and add 'Referer'

  • @fernandamello837
    @fernandamello837 10 місяців тому

    Wow!!! This is awesome!!! You have so easy way to teach, I already have a base with Python but I’ve never made this before and you make this so smother and easy to do!!!! Thank you thank you ❤

  • @ramakumarguntamadugu1299
    @ramakumarguntamadugu1299 2 роки тому +1

    thanks Alex! really a great video... request you to kindly do a similar one on stocks realtime price capturing with time series and configure an email notification when the current price drops below say 50 day moving average ....
    I am looking forward for many videos like this...thank you!

  • @user-md6gb5ko9t
    @user-md6gb5ko9t Рік тому +5

    This script is only giving me short html and I've got "NonType" value at the end.

  • @AlexHitchon
    @AlexHitchon Рік тому

    Thanks Alex I am working on my own web scraping project for checking placements of searches and this video definitely helped

  • @juandavidmoralesnavarrete3072
    @juandavidmoralesnavarrete3072 Рік тому +7

    This seems like an amazing project, sadly something change in Amazon policy for scrapping their data and I couldn't access, if someone find a way to make it work I would love to hear it 😁I'll keep going with the other projects!!

    • @foodamormore
      @foodamormore Рік тому

      so whoever is not able to find the id for the price and are getting tag 'span' and class on clicking on the price(mentioned on the website of the product) in inspect can follow this code
      price=soup2.find("span", attrs={'class':'a-price-whole'}).text.strip()
      print(price)
      replace 'a-price-whole' with whatever you are getting for the class

    • @ejidohugochi2858
      @ejidohugochi2858 Рік тому

      Where you able to access the site at all?
      I did get an error 503 right from the beginning while trying to request the url. However I decided to use my selenium web drivers and it worked for me…. If you don’t know how to use that then I suggest you scrap another website. Amazon has gotten tighter.

    • @tevzuss4386
      @tevzuss4386 Рік тому

      You can use Selenium to bypass all of their human checks. But it's a bit more advanced subject.

  • @amanvats7966
    @amanvats7966 2 роки тому +11

    I'm getting this error when trying to print the title using soup2: tried to resolve it but not.. let me know if anyone has the solution for this:
    AttributeError: 'NoneType' object has no attribute 'get_text'

    • @mayokunsoetan7531
      @mayokunsoetan7531 2 роки тому +1

      getting the same error
      Have you been able to solve it?

    • @farazbhatti6120
      @farazbhatti6120 2 роки тому +1

      Been having the same issue, for a second the code worked and all of a sudden it stopped working
      @alex could you please guide why this is the case when we run the code and how to resolve it.
      (I think its due to amazons security protocols that detect either a bot or a programming language that's trying to fetch the data.)

    • @mDevinm
      @mDevinm 2 роки тому +2

      @@farazbhatti6120 Amazon has basically caught onto this method of web scraping their site. A newer method involves rotating your user agents constantly - essentially to look like you're accessing Amazon from different devices. However, you also need to pair this with a proxy, otherwise Amazon would see you're trying to access Amazon from different devices, all from the same IP, hundreds of times a day. It's a lot more complicated now and the video is no longer working unfortunately.

    • @jay83x
      @jay83x 2 роки тому +1

      same issue here for me! I want to continue with the project but I cannot due to this same get_test error message! @alex please help

    • @muzzammilsiddique417
      @muzzammilsiddique417 6 місяців тому

      similar error

  • @SayedKassem-pn7tr
    @SayedKassem-pn7tr Рік тому +1

    Your tutorials are so good. and i follow you on LinkedIn, your content is awesome. i love how you explain things in a clear way. keep up the great job!!

  • @AIdevel
    @AIdevel Рік тому +1

    I am absolutely fascinated by your thorough explanation

  • @syaoransakura8839
    @syaoransakura8839 2 роки тому

    After a looooong time delay cause by many things, finally I can finish this portfolio.

  • @aayanmalhotra1104
    @aayanmalhotra1104 3 роки тому +2

    One of the only channels with least haters ✨

  • @NathanEckelTV
    @NathanEckelTV 2 роки тому

    Thrilled to successfully get to the end of this @Alex - appreciate these real-world worked examples.

  • @okonkwolouis902
    @okonkwolouis902 Рік тому +3

    Hello Alex,
    thank you so much for all you do. I am using this video now when Amazon doesn't include the word 'price'. While inspecting how do I go about that. I hope you reply because I am sure lot of new learners are having this issue.

  • @mitchellharding305
    @mitchellharding305 3 роки тому +4

    Super early, love your stuff as always Alex!

    • @AlexTheAnalyst
      @AlexTheAnalyst  3 роки тому +4

      You are very early! Lol Thanks for watching 😁

  • @foodmaker5771
    @foodmaker5771 Рік тому +1

    Did you uploaded the second part.
    I loved this one.
    Please share second one

  • @riteshkumar1497
    @riteshkumar1497 Рік тому +5

    NoneType' object has no attribute 'get_text'. Iam facing this error

  • @markchinwike6528
    @markchinwike6528 5 місяців тому

    Thank you so much, Alex! Your teaching style has made learning incredibly enjoyable and accessible. I've learned a lot in just one month and completed my portfolio projects, even though I skipped Excel and Power BI for now. Your anecdotes about your dog, family, and personal experiences have added a fun touch to the learning process. Your impact on learners like me is undeniable, and I'm looking forward to purchasing a course from your website soon. Keep up the fantastic work! 🥂🥂

  • @Philip_thinkData
    @Philip_thinkData 3 місяці тому

    Wow, this is EXACTLY what I have been looking for. Alex the GOAT in DA. :) You are 1000x Awesome!

  •  7 місяців тому +6

    Help im really having issues with "AttributeError: 'NoneType' object has no attribute 'get_text'" I have tried everything I could think of, how can I resolve this.

    • @qlintdwayne9044
      @qlintdwayne9044 7 місяців тому +1

      experiecing the same. Used an if loop to determine whether the title exists, apparently it doesn't

    • @abrilgonzalez7892
      @abrilgonzalez7892 5 місяців тому +2

      Same here !!!
      I'M STUCKED IN MINUTE 16:35,
      the code doesn't work :(
      ¿Could someone help us please?
      Thanks you!!

    • @yashwanthgunturi8762
      @yashwanthgunturi8762 4 місяці тому

      did you find a fix? I am having the same problem.

    • @Reyhanemohamadinejad
      @Reyhanemohamadinejad 4 місяці тому

      @@yashwanthgunturi8762
      Also for 'title ', you can type the text below after soup's definition:
      title = soup.find(id='productTitle').get_text()
      print(title)

    • @varunkhandelwal623
      @varunkhandelwal623 2 місяці тому

      @@yashwanthgunturi8762 yeah I found the error use this code
      title = soup2.find(class_='a-size-large product-title-word-break').get_text(strip=True)

  • @Atlas92936
    @Atlas92936 3 роки тому +4

    "Guys if you can't tell, I'm in need of some help here" 😂😂😂

  • @jaimebaker1806
    @jaimebaker1806 2 роки тому +4

    BTW some of the website code amazon has changed. New people will need to adjust accordingly.

  • @bryan.canelas
    @bryan.canelas 2 роки тому +1

    Thanks Alex! this was really useful. I am waiting for the second part with the pagination 😅😅

  • @shivangisharma3696
    @shivangisharma3696 Рік тому +9

    Done this project recently and anyone faces the error please edit the code and write this instead
    title = soup2.find('span', attrs={'id':'productTitle'}).get_text()
    price = soup2.find('span', attrs={'class':'a-price-whole'}).get_text()

  • @oriakuotito3985
    @oriakuotito3985 Рік тому +1

    Hi Alex, still waiting for the other video. thank you

  • @MrAdhito
    @MrAdhito 3 роки тому +2

    I really like these long videos where you explain things like this instead short video, thanks for uploading Alex !

    • @AlexTheAnalyst
      @AlexTheAnalyst  3 роки тому +2

      Glad to hear it! I try to change it up every so often :)

  • @sharon_ng
    @sharon_ng 2 роки тому +3

    Hey Alex, thanks for the walkthrough. When is the next web scraping project coming? I'm so hyped.

  • @badissjabou252
    @badissjabou252 Рік тому +2

    hello Alex?
    Thank you for this amazing tuto, it help me so much
    please did you do the video for all the website
    like how to scrape all the page
    thank you again

  • @pangtoubear6923
    @pangtoubear6923 Рік тому +4

    Very nice tutorial! The amazon seems to change the code on the id = priceblock_ourprice part, could you update the code accordingly?

  • @yashwanthjetty7845
    @yashwanthjetty7845 3 роки тому

    Thanks a lot for enlightening on Web Scraping. Came to know only after watching this video that such stuff can be done.

  • @AimanDaud-z1v
    @AimanDaud-z1v 2 місяці тому +2

    Hi, why do i get this error "AttributeError: 'NoneType' object has no attribute 'get_text'" i don't understand this can anybody help how to solve this?
    TIA

    • @prachivarshney160
      @prachivarshney160 2 місяці тому +1

      it cannot find that id named priceblock_ourprice anymore, therefore it returning None

  • @Tesseus2006
    @Tesseus2006 11 місяців тому

    Loved the video. But I really bursted out laughing when you said: I don't want my head to be here for the entire time. I'm gonna get rid of myself!" I thought to myself: Not a good head space to be in. 😅 You are naturally funny.
    Thanks for the knowledge and laughter.

    • @jachimmachristian457
      @jachimmachristian457 10 місяців тому

      His simplicity and humor gets me every time and it helps with the flow of his lessons. So amazing

  • @blackwhite2361
    @blackwhite2361 3 роки тому

    I thought you were now only gonna only make videos on management and stuff. Glad you are still making tutorials

    • @AlexTheAnalyst
      @AlexTheAnalyst  3 роки тому +1

      Nah, content really won't change much - I'll be doing Tableau tutorials very soon

  • @mercantilism954
    @mercantilism954 3 роки тому +1

    This is what I have been waiting for!
    Thank you

  • @zweedao4990
    @zweedao4990 Рік тому +4

    Here is a potential fix for the common error: change "html.parser" to "lxml"

    • @AbhinaY1437
      @AbhinaY1437 Рік тому +2

      Thanks a lot , using html.parser amazon is restricting to scrape

    • @arpantyagi1453
      @arpantyagi1453 11 місяців тому

      It works as of now. Thanks

    • @cookies521400
      @cookies521400 11 місяців тому

      I LOVE YOU

  • @demr5251
    @demr5251 3 роки тому +1

    Wonderful! I'll practice with this tonight!

  • @shivamsharma379
    @shivamsharma379 3 роки тому +8

    Hello i'm getting this error,
    AttributeError: 'NoneType' object has no attribute 'get_text'
    can anyone guide me through it?
    Thanks a lot in advance.

    • @Theknightlm
      @Theknightlm 3 роки тому +2

      Same error here

    • @MadhavManohar
      @MadhavManohar 3 роки тому +3

      I tried with a different product and it works just fine. My guess is multiple people have pinged the same URL so amazon went ahead and blocked it. Try a different product.

    • @azhiylo6403
      @azhiylo6403 3 роки тому +2

      Same here, just be sure that the price is avaiable in your zone. In my case the item was not displaying the price, so it is not available to the code. I changed the product, and then it was fine :)

    • @shivamsharma379
      @shivamsharma379 3 роки тому +1

      @@azhiylo6403 thankyou brother, my issue is resolved now.

    • @azhiylo6403
      @azhiylo6403 3 роки тому

      @@shivamsharma379 great 💪🏻you are welcome

  • @paulbuono5088
    @paulbuono5088 Рік тому +2

    The code gives me an error with the price (the product title works though). I get an error "AttributeError: 'NoneType' object has no attribute 'get_text'"

  • @PratapO7O1
    @PratapO7O1 3 роки тому +1

    Oh man I was thinking about a project related to amazon data scraping and here youtube suggested me B-)

  • @ArtAndTechWithNicolas
    @ArtAndTechWithNicolas Рік тому +5

    When I try to run the first cell, I get the error message
    I think Amazon updated their site to make it harder to scrap data. Do you agree?
    (Edit)
    Fix: soup2.find(‘span’,{‘class’:”a-offscreen”}).text.strip()

  • @manishkumarsingh5982
    @manishkumarsingh5982 2 роки тому +1

    When will be the next part of web scraping? Thank you for posting this video!!!!!

  • @djmariohh
    @djmariohh Рік тому +3

    Hi Alex, this was really great! Thanks for doing this video. Did you ever do the follow-up video that was mentioned at the end of this video?

    • @sim9955
      @sim9955 Рік тому +1

      i'm interested in that follow up as well!!

  • @sergioramos3437
    @sergioramos3437 2 роки тому

    Love this .. I'm curious about the headers part I didn't know about that before

  • @litoavila.
    @litoavila. Рік тому

    You have 3 kids! and you are 28, omg you are back as my old wise sensei, master yoda.

  • @mukoko99
    @mukoko99 Рік тому +3

    Can someone direct me to the other project that you discussed doing in this video. Where you build a scrawled that goes through each page’s content and gets their prices

  • @vintage-cartoons
    @vintage-cartoons Рік тому +2

    Really enjoyed this video! Any update on when the one for multiple pages would be ready? I didn't see it on your channel

  • @zebaszd
    @zebaszd 3 роки тому +1

    man it was super easy to understand, you nailed it

  • @erkanlacin4729
    @erkanlacin4729 3 роки тому +1

    You are great, this is exactly what is am looking for...

  • @pomme_paille
    @pomme_paille 3 роки тому +1

    Thank you! Amazing. Waiting for the next video 😉

  • @daniyalahsan6166
    @daniyalahsan6166 2 роки тому +3

    at 14:20.. title = soup2.find(id="productTitle").get_text() is giving me this error: AttributeError: 'NoneType' object has no attribute 'get_text'.. can you or anyone else give an idea about why this is happening. Is it possible that amazon is no longer for scraping?

    • @mDevinm
      @mDevinm 2 роки тому +3

      Amazon has basically caught onto this method of web scraping their site. A newer method involves rotating your user agents constantly - essentially to look like you're accessing Amazon from different devices. However, you also need to pair this with a proxy, otherwise Amazon would see you're trying to access Amazon from different devices, all from the same IP, hundreds of times a day. It's a lot more complicated now and the video is no longer working unfortunately.

  • @sidharthkoparde9183
    @sidharthkoparde9183 3 роки тому +2

    Really cool project with an email feature in the end! Thanks, Alex.

  • @michelchaghoury870
    @michelchaghoury870 2 роки тому

    Mannnn pleaseeee keep going we need your help you tuts are on a whole diff level I am able to learn and understand with ease tnx a lotttttt and once again keep going

  • @kyriacoskoullapis1748
    @kyriacoskoullapis1748 2 роки тому +10

    Great video! I am stuck on the part where you print the price. I cannot find 'priceblock_ourprice' anywhere. It seems like they changed the way they display their price somehow.

    • @ekaanshkhosla
      @ekaanshkhosla 2 роки тому

      Same here

    • @diogenes1683
      @diogenes1683 2 роки тому +2

      Looking at HTML from another product I found id="corePrice_feature_div" and id="corePrice_desktop" . I tried the first one and it worked

    • @mayamadikwane9866
      @mayamadikwane9866 2 роки тому

      @@diogenes1683 thanks for the info, nearly broke my brain looking for a price that made sense.

    • @mayamadikwane9866
      @mayamadikwane9866 2 роки тому +1

      but mine worked with id='apex_desktop'

    • @graythings
      @graythings 2 роки тому +12

      if you have problems with the price not having an id use its class instead, your code should look like this
      price = soup2.find('span', {'class':'a-offscreen'}).get_text()
      this should give you the price.

  • @mphorasenyalo1230
    @mphorasenyalo1230 2 роки тому

    from the first position, that's the word you were looking for.

  • @suyashverma800
    @suyashverma800 3 роки тому +2

    Sir please make more portfolio projects for fun

  • @aadhithyanp6989
    @aadhithyanp6989 3 роки тому +3

    Thanks man. You are helping a lot of people like me. Keep doing this portfolio videos!

  • @robertoenriquehiguera2648
    @robertoenriquehiguera2648 3 роки тому +1

    Thanks Alex. I’m a big fan.