Beautiful Soup 4 Tutorial #4 - Finding The Best GPU Prices

Beautiful Soup 4 Tutorial #4 - Finding The Best GPU Prices

Tech With Tim

2 года назад

69,284 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@furkanozata6775
@furkanozata6775 - 26.10.2023 23:42

What a video 👏👏

Ответить
@GuillaumeBesson1
@GuillaumeBesson1 - 27.09.2023 13:48

Looks like newegg is a bit fed up with webscraping ... Just got a warning in my doc file

Ответить
@realestateinvestingco
@realestateinvestingco - 12.09.2023 17:42

Quick question but why didnt you index by the attributes inside "><"? Would retrieve 3 results which would be cleaner than the ones in the procedure adopted in the video

Ответить
@user-hf5cz8nq4b
@user-hf5cz8nq4b - 27.08.2023 16:50

Hi Tim thank you for this awesome video! Question How would you go on by sending this to a text file.
with open('GPU_prices_newegg.txt', 'w') as file:
file.write(str(item[0]))
file.write(str(f"${item[1]['price']}"))
file.write(str(item[1]['link']))
file.close()
This only gives me the last data it finds not all of it. Thank you

Ответить
@sinaorojlo5980
@sinaorojlo5980 - 01.08.2023 14:46

Awesome course ❤

Ответить
@rafaelgranado4168
@rafaelgranado4168 - 31.03.2023 15:10

Great content mate. Good explanations and I look forward to more videos like this...👌✊

Ответить
@alejandrocarmonaligeon
@alejandrocarmonaligeon - 23.03.2023 00:22

Great series! I learned a lot today

Ответить
@santoszambrano5187
@santoszambrano5187 - 11.03.2023 23:12

Thanks for the video. I am getting an attribute error for "price". It says " 'none type' object doest not have an attribute 'find' ". Can I get a response from someone about this please.

Ответить
@1Manda1
@1Manda1 - 06.03.2023 11:31

how does this .parent part work I dont quit get it and I am unfamiliar with it. Help is much appreciated.

Ответить
@raffymcfee9846
@raffymcfee9846 - 30.11.2022 15:05

Can I use this in freelance work after I finish your series?

Ответить
@JeyadarshiniRaja2020
@JeyadarshiniRaja2020 - 15.09.2022 19:05

Thank you so much for this series, Tim! You're doing an amazing job!

Ответить
@mvaupot2610
@mvaupot2610 - 23.08.2022 17:32

i have a problem, i have the same code, but in line 31 it says "NoneType object has no attribute 'find'", i tryed averything but it didnt work

Ответить
@jelco8740
@jelco8740 - 18.08.2022 14:11

Not sure if i make a mistake or the webshop changed something, With search query i get on the site 8 pages, and with the script 100 pages. Also when i do it with an other search query

Ответить
@neilkumar3626
@neilkumar3626 - 03.08.2022 20:35

Adidas is better

Ответить
@srichaidiamond1032
@srichaidiamond1032 - 17.06.2022 02:03

Sorry im completely new to data science sort of topics.
What is that italicized f thats in front of the newegg url? He casually threw that in there, Im assuming is something fundamental that i missed.

Ответить
@alistair6151
@alistair6151 - 16.06.2022 20:17

Thanks! Great series! Enjoyed it a lot

Ответить
@unpatel1
@unpatel1 - 14.06.2022 05:31

Just finished all 4 videos inthis series. All were great, thank you. I would love to see more advanced videos on this topic from you in the future.

Ответить
@jalepenofatty6704
@jalepenofatty6704 - 13.06.2022 18:36

nvm figured it out gpu variable needed changed

Ответить
@JeandrePetzer
@JeandrePetzer - 07.06.2022 08:21

Happy to let you know that the cheapest GPU is now $1500 less than it was at the end of this video :)

Ответить
@AndreasLvgaard
@AndreasLvgaard - 12.05.2022 16:28

Hi Tim! You are doing a great job. I am following your videos about web scraping :)

One thing I don't fully understand is: why do you persist in using the attribute '.string' after you have used the '.find' method from the variable 'doc'? Why not just use the '.text' attribute?
I just try to understand why the '.string' attribute is better or why I shouldn't use the '.text' attribute?

My solution for the chapter "Querying multiple pages":
# code above is something you already typed
page_text = doc.find(class_='list-tool-pagination-text')
last_page = int(page_text.text[-1])
print(last_page)

Ответить
@vitaly_p
@vitaly_p - 08.05.2022 11:36

Great tutorial! Keep it up!

Ответить
@austintaylor7743
@austintaylor7743 - 12.04.2022 02:22

Tim, how do can i make the price an integer? Ive tried to figure it out but i get a TypeError saying it must be a string. There must be a way. Can someone help me out?

Ответить
@bigappleNYrules
@bigappleNYrules - 23.03.2022 23:29

sorted_items = sorted(items_found.items(), key=Lambda x: x[1]['price'])

Hello everyone, i keep getting an error saying that maybe i need a comma for the Lambda, any tips?

Ответить
@shravankale5542
@shravankale5542 - 07.03.2022 23:17

Hi,
I want to find the text of only given tag and not its child tag. Is there a way to get text of HTML tag without getting text of its child tag?

Ответить
@ninjaman570
@ninjaman570 - 24.02.2022 22:50

How would you edit your code to only output the top 5 best prices in your list? I'm kind of new to python and Im not sure how you would take the whole library, have it sort it from lowest price to highest price, then ouput the 5 lowest prices and provide the name, price, and link

Ответить
@caiopjv
@caiopjv - 23.02.2022 05:47

Great Video! Thanks

Ответить
@houstonfirefox
@houstonfirefox - 28.01.2022 16:17

Great video. I did notice that you had
for page in... as your iterator with an implied type of int (for counting the pages)

then you modified both the content and type of the variable 'page' immediately afterward when you set that variable to the text of the web page itself. I'm surprised the code continued to run afterwards. Might account for some of the strange results and workarounds you had to do afterwards. These things are insidious sometimes lol

Ответить
@unostationery9608
@unostationery9608 - 18.01.2022 14:38

This is what I get when I run

What product do you want to search for? 3080
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-12-8beb69a205b7> in <module>()
9 doc = BeautifulSoup(page, "html.parser")
10
---> 11 page_text = doc.find(class_="list-tool-pagination-text").strong
12 pages = int(str(page_text).split("/")[-2].split(">")[-1][:-1])
13

AttributeError: 'NoneType' object has no attribute 'strong'

Ответить
@AhsanAli-sq5hd
@AhsanAli-sq5hd - 01.01.2022 23:02

I followed this whole video and did all things you did but instead of getting 3080's, I'm getting pre-built pcs with rtx 3080 in them! Any idea why's this happening?

Ответить
@johnsteriman5949
@johnsteriman5949 - 27.12.2021 09:08

I understand this is a bit of a shot in the dark, but I'm having a problem with some code.
I decided to try to go off on my own a bit in some of the code, but I keep having problems with the BeautifulSoup methods working on anything besides "doc".
For example, price = div.find_all("...") or current_price = price.find_all("...") doesn't work.
I don't know if I'm missing something very basic and easy, but regardless, if anyone has a solution I'd love to hear it.

Ответить
@lucychan494
@lucychan494 - 11.12.2021 20:40

that was awesome I actuall understood :O
you are a life saver ,thank you very much <3

Ответить
@VeauX1902
@VeauX1902 - 05.12.2021 03:42

ha! got banned by newegg while doing trials an error following the course

Ответить
@samuelmino2536
@samuelmino2536 - 18.11.2021 05:28

hey man having trouble with what you did in the command prompt if i could get some help

Ответить
@garethma7734
@garethma7734 - 09.11.2021 18:17

Is there any reason not to use regex? All the splitting makes the code unmaintainble especially when there's no comments explaining haha.

Ответить
@alexanderstamov2237
@alexanderstamov2237 - 24.10.2021 11:09

Hi Tim, can you make a fifth video where you scrape an infinite scroll site/blog?

Ответить
@Nathan-ng1kp
@Nathan-ng1kp - 14.10.2021 21:47

Tim, watching this tutorial series has been a pleasure. Seeing your workflow and application of python techniques is very informative!

Can anyone recommend a resource that further explores the "rules" and "ethics" of web-scraping in the wild?

Thanks!

Ответить
@robertmcelfresh1031
@robertmcelfresh1031 - 24.09.2021 04:25

Thanks for this series. I have not watched them all yet but I might suggest you start your development by using a browser and SAVING the web page to a local file. Now do all your development by reading your local copy. This way you dont hit the web page dozens of times which might get you noticed or banned. Once you get all your development done - then hit the real URL going forward.

Ответить
@mortezakhosravi8579
@mortezakhosravi8579 - 21.09.2021 13:51

Welldone, you are amazing boy

Ответить
@TimeToGG
@TimeToGG - 19.09.2021 18:20

Nice!

Ответить
@Gastell0
@Gastell0 - 17.09.2021 03:25

When you imported re I feared you're going to try and use it to find stuff in html without parsing it xD

Ответить
@DispelTV
@DispelTV - 17.09.2021 01:47

Why not use print(int(page_text.contents[-1])) to get the last index?

Ответить
@ccrsxx
@ccrsxx - 16.09.2021 08:12

Dataframe is nice use here

Ответить
@p-a5603
@p-a5603 - 11.09.2021 21:36

Cool!

Ответить
@zaidouardi7901
@zaidouardi7901 - 11.09.2021 15:17

Pls make a python and programming basics course.

Ответить
@portmax95
@portmax95 - 11.09.2021 13:49

Cool videos TIm i really enjoyed..... you should make some videos about sentiment analysis

Ответить