Begins with, "If you're poor, you're gonna love this episode". Noice.
@Sooyush5 жыл бұрын
Toit
@MsKoniki5 жыл бұрын
Cool cool cool cool cool
@mahmouda.khalifa5 жыл бұрын
I smell pennies
@ohokcool5 жыл бұрын
AM POOR, FEED CONTENT PLS
@35-barodmaftuhniam765 жыл бұрын
Bored i think
@MarioOrtiz0085 жыл бұрын
Instead of price[1:5] you could have used price[:-3]. That way, the actual length of the string doesn't matter. It will just remove the last 3 characters (decimals + € symbol)
@RickyC06265 жыл бұрын
Or you can do price[1:] to get all the characters after the currency symbol and cast it to float. The resulting value can also be used to calculate total price for a list of products
@Chemistry-uh2gj5 жыл бұрын
@@RickyC0626 Good idea!
@borispsalman5 жыл бұрын
or use regular expressions but as for me i still dont understand them fully :D
@CFabio65 жыл бұрын
This! if the price goes under 1000 it's gonna crash with price[1:5]
@sidheshwartiwari98345 жыл бұрын
Noice
@jakeruth46035 жыл бұрын
"It will never stop, just like my mental state." Once again, I am left with more questions than answers. Thank you Ed -jake
@ramiiii4 жыл бұрын
wonderful.
@Sagar_Sorout4 жыл бұрын
It's not working in my system
@Sagar_Sorout4 жыл бұрын
It's not working
@buybestphone4 жыл бұрын
@@ramiiii amazing too.
@alialshah84663 жыл бұрын
Will the program continue running if I close the pycharm
@gimmeplaylistnow5 жыл бұрын
This dude: "Okay, if you're poor, you're going to love this episode! Me: "I'm listening..."
@69erthx11385 жыл бұрын
Me: No shit-te!
@ob_isaiah4 жыл бұрын
Haha
@reaperagario29614 жыл бұрын
Just to clarify! 1) On 13:45 he uses two ' ' (newline) because the SMTP protocol wants you to format the email this way: Subject: YOUR_SUBJECT //empty_line ACTUAL_MESSAGE . //a line only with a dot 2) On 11:31 he connects to the mail server through the port 587 because that's the default port SMTP uses. SMTP also uses TLS to send the data through packets and they're encrypted. Enjoy!!
@JosepPi5 жыл бұрын
sees while(true) *Yells in C++*
@dmitrov64645 жыл бұрын
*Never stops yelling*
@davidson23295 жыл бұрын
I started learning c++ and I am now kinda used to it and when I look at this... why didn't he make a universal function....
@zaraf5 жыл бұрын
I was so triggerd
@walfranpinto805 жыл бұрын
im new to coding, mind explaining?
@psd.31445 жыл бұрын
@@walfranpinto80 it's just an infinite loop that will always run when the program gets to it. True is always true so it will never not run. You usually want some kind of limit on how much a loop can run, especially in something like the c language family. Python kinda saves you from bad memory management because it does a lot on it's own, but it is a convention not to do that if others are working with or going to use your code. Since this is more of a concept style of video tutorial, it isn't really an issue though.
@lolmeeky2 жыл бұрын
thank you so much for this tutorial! some things dont currently work (since this video is a few years old now and Amazon has changed your ability to scrape from them, it seems), but I still learned the basics about web scraping from this! I changed up my program to also send price differences from other websites too. Even the parts about 2-factor verification were useful and now its something extra I know! Thanks again!
@shahfahad.muslim5 жыл бұрын
I'm not still in Python, but subscribed to make sure that this awesome man stays when I need him. thanks for cool stuff bro.
@user-te1le7ck6b5 жыл бұрын
Brilliant as a computer science teacher I will be utilising this for a project Keep up the great work
@hamidnikbakht12954 жыл бұрын
This guy is a legend! Just look at the way he sits behind his computer and in front of camera!
@onrebruit5 жыл бұрын
Your videos are natural and unique. You make me feel we are having one on one tutorials.
@andreaf61435 жыл бұрын
Good sample but anyway you have to use in headers the directive 'Cache-Control': 'no-cache' else you will see the same page always and you can't get the new price. headers = {'Cache-Control': 'no-cache', "Pragma": "no-cache"}
@alexanderandrukov99035 жыл бұрын
Are u sure? Shouldn't it check first the date of the last real update of a page before returning cached page? Hint: there is a special header for that in HTTP protocol.
@devmarkk5 жыл бұрын
i'm interested, following the conv
@TrimorphMC5 жыл бұрын
15:05 Duplicate code; you forgot that you already wrote that!
@nourios69915 жыл бұрын
Marked as duplicate.
@nonsudunk5 жыл бұрын
@@nourios6991 I understood that reference!
@saptarshisengupta50735 жыл бұрын
What do you expect. They know shit about programming.
@clank22694 жыл бұрын
@@saptarshisengupta5073 what
@DontBeMadBro5 жыл бұрын
just to point out, remember that price[0:5] will not be effective for smaller prices, in such a case, i would consider split this string by delimiter, which is dot and then save the first part of the outcome. This way script won't be dependent by different number of digits, nice tutorial!
@HaynesX5 жыл бұрын
Why not just .replace() the comma and currency symbol with nothing and convert to float to get the exact price? Or is that very inefficient?
@98Etienne985 жыл бұрын
Thank you! I'm trying to learn python and little projects like this are really what i was looking for!
@aipython4 жыл бұрын
Good to know that you are interested in Python project, I have also created a playlist for Python project. Do check it: kzbin.info/aero/PLBeeFF3JmXWCQh987TsdowLK5U8XwbSzw
@idhamarsyd5 жыл бұрын
Awesome!! Maybe you can share your setup about VSCode, sir! Your theme, fileicon theme, font or even useful extension. Thanksss
@balhazer5 жыл бұрын
x34, deliver dude, pretty please!
@nikolayvarlamov40655 жыл бұрын
Matherial theme He has a video about his VS CODE config: kzbin.info/www/bejne/i33WpINsaKabhtk
@kentlai5 жыл бұрын
I'm a Python beginner, your video is awesome. Please make more Python tutorial
@poly20814 жыл бұрын
5:18 someone at amazon has too much time
@schavan14 жыл бұрын
LMFAO
@alwinvillero44044 жыл бұрын
wtf
@eatdapoopoo674 жыл бұрын
Duck boi
@rogerm4a14 жыл бұрын
I was wondering the same thing! LMAO
@hiwab414 жыл бұрын
.__(.)< (MEOW) \__)
@notrash42564 жыл бұрын
If you want to make it more flexible try: pricewithouteuro = price.replace('€','') pricewithouteuro = pricewithouteuro.replace(',','.') convertedprice = float(pricewithouteuro) print(convertedprice)
@ugurkoc30305 жыл бұрын
For who has problems about converting string to float, you should replace coma with point price = soup2.find(id= "priceblock_ourprice").get_text() converted_price = float(price[1:6].replace(",",".")) print(converted_price) Output = 1.998
@jackbird58393 жыл бұрын
I am python beginner and this simple application will give some good practice great solution and tips bro!! thank you for your video. as a non-tech user, I am using amazon review scraper e-scraper maybe it helps to somebody too.
loving the python tutorials! It'd be awesome if you did a python app with some interfaces or something. 😄
@utsavprabhakar50725 жыл бұрын
Trueeee
@CrypticConsole5 жыл бұрын
Just write the price to a tkinter frame
@nathanwise92715 жыл бұрын
Tkinter is fun...
@Towzlie5 жыл бұрын
Python isn't mean to dev GUI apps
@nathanwise92715 жыл бұрын
Towelie why not?
@GabrielsEpicLifeofGoals5 жыл бұрын
I am only concerned at the fact that Amazon used "MEOW" somewhere in their code...
@gatikgarg40074 жыл бұрын
That was a comment
@hidalg4 жыл бұрын
jajajaja me too
@CODEBYTE4 жыл бұрын
someone had too much time to include that . Lmao .
@mohamedaminealouini42925 жыл бұрын
There are 2 enhancements for this video First one: You could pass the URL as an argument, so the function could be more generic Second: If you were on Linux (I don't know about Windows), you could use CRON Jobs to execute the code Nice job and good episode
@patriotsecular66315 жыл бұрын
hey ed, prashant here.. i appreciate the way you are always smiling and something in the presentation takes the stress out of the coding part :) I am a subscriber to the channel now ::)
@aryankatebain5 жыл бұрын
Man please more videos... You are a fantastic teacher 👨🏫
@raqha45755 жыл бұрын
"And dont send 1000 request to mess with their server"... pff you know us. We never wanna do things like this...
@FlyingUnosaur3 жыл бұрын
Amazon isn't very pro scraping. They'll block you real quick.
@16bitart3 жыл бұрын
@@FlyingUnosaur True, that's way I had to develop scraper that use 50+ threads to collect thousands of products every day.
@FlyingUnosaur3 жыл бұрын
@@16bitart did you use proxies?
@16bitart3 жыл бұрын
@@FlyingUnosaur Yes, this is only way. But I used free proxies with rotation.
@FlyingUnosaur3 жыл бұрын
@@16bitart ok thank you
@JarosawTabor5 жыл бұрын
Ok. After this video I'm definitly sure, that I want to learn Python. Damn. Easy win.
@DarrenSemotiuk5 жыл бұрын
Seems python = crush JavaScript first, then forget { } exist instead just indent #ez
@pythonwonderwoman71644 жыл бұрын
I have added also 'else' with small print to inform me that price has not changed without while True loop. and I used Windows task scheduler to check the price once per day. thanks a lot, love your positive attitude!
@Sawell1234 жыл бұрын
I found a solution for the "none" return/error instead of the title (or price - depends what you want to scrape): instead of writing soup = BeautifulSoup(page.content, 'html.parser') I used soup = BeautifulSoup(page.content, 'lxml') and it works for me. I got to the point that i can send emails :) thanks for this tutorial!
@nmana97594 жыл бұрын
Thank you so much!!
@sagargada735 жыл бұрын
" In python we are cooler we do this the other way" 😂😂😂
@brewman4674 жыл бұрын
Afaik there is no Import in JavaScript. However it exists in NodeJS.
@alialshah84663 жыл бұрын
Would the program still run if I close pycharm
@damnatioodiosis55373 жыл бұрын
@@alialshah8466 i had the same doubt
@prajwalpkulkarni4 жыл бұрын
Thank you Dev Ed! This works! I feel so powerful right now xD Looking for more tuts from your side! Cheers from India!
@MaBuSt4 жыл бұрын
this was a great episode, thanks! i'm new here but appreciate the simplicity - almost would prefer you also show you googling the things you googled to FIND the packages you dl'd and imported. SOunds a little goofy, but really new people often ask how you knew what packages to use, and it's so helpful to show experienced people googling it.
@Marco1109813 жыл бұрын
You can have this python script executed in crontab (if using Linux), so the script will be run systematically some, say, 1 or 2 times a day, and the price will be checked in the background without even noticing it. I included the logging of the price to a text file, and the plot of its temporal evolution so to have a nice overview of the trend, and for each item I have included in a a list (with its belonging threshold). Keep it up, Dev Ed - nice going!
@susannam39232 жыл бұрын
did anyone else have the problem where the soup data was really short and had things like "if you want access go to some Subscription API" and "we want to make sure you're not a bot and you should enable cookies"
@gulle75785 жыл бұрын
“HAVE YOU HEARD OF HONNEY!” “THIS VIDEO IS SPONSORED BY HONEY” “THIS VIDEO WOULDN’T BE POSSIBLE WITH OUT HONEY”
@melatoninik4 жыл бұрын
MisterabEAST lol
@NackDSP4 жыл бұрын
Awesome. I set this up on my Raspberry Pi and had it ring a bell when my price target was reached. Saved me $100 today.
@adityashinde38645 жыл бұрын
Please make more JavaScript videos.
@developedbyed5 жыл бұрын
Will make js videos too don't wory, but it can get a bit monotone for me to only do that 24/7 😀
@krishnaprasad33505 жыл бұрын
SMTPLIB stands for Simple Mail Transfer Protocol LIBrary. It is used to send,read,etc emails on a basic level.
@pistolpeet53255 жыл бұрын
smtplib is a library in Python that uses the SMTP(simple mail transport protocol) layer to send emails from a client
@kimzauto50455 жыл бұрын
hmmm Yahoo?... internet modem flash backs🔥🔥🔥🔥🔥
@cheskoxd4 жыл бұрын
9:15 he googled python web scrapping amazon XDXDXD i love this man xd
@nonamenoname26185 жыл бұрын
But as soon as you close the program (the code in Virtual Studio) you also close the loop, correct? So you need to have your python-program continuously running?
@TheDirtyClean5 жыл бұрын
Noname Noname yea same thoughts. Has to run on a server to be not useless i guess :D
@johnmcmenamin76924 жыл бұрын
Or use cron/a scheduler to run it occasionally
@Lukas-ds4qp4 жыл бұрын
I would like to program a dynamic logogenerator with export and preview function in Python. Specifically, an existing image is to be supplemented by five entries - after which the supplemented logo can be exported as ".zip", where .png, .pdf, and .png of the logo can be found. In addition, there should be two preview areas, which should dynmaically adapt to what has been entered in the above mentioned entries. There will be two preview areas to the right of the five entrys
@ericlin83315 жыл бұрын
I need this guy in my life Subscribered.
@3AgL3DeeJay5 жыл бұрын
13:19 why not just add the "URL" variable after that string? that way you won't have a problem if you modify only the link above and forget about the second one
@jasperdiscovers5 жыл бұрын
came here looking for this comment :)
@3AgL3DeeJay5 жыл бұрын
@@jasperdiscovers Nice :))
@PauJuanes5 жыл бұрын
And literally ONE second later he uses f' ' string formatting to explain how to include a variable inside a string LOL. He also called the send_mail() function twice with two identical if statements. I guess he forgot he already wrote that piece of code two minutes earlier. Anyway, he did a really good job. Not complaining at all.
@povilaskirna41085 жыл бұрын
You should explain how to make it run silently and on the start of the pc
@adventune3755 жыл бұрын
(On windows 10. Haven't tested on other versions of windows or any other os) Make the .py file .pyw file. Then type win+r and type 'shell:startup'. It will open a folder where you move your .pyw file or shortcut to it. Next time you boot it will run script silently on the background. You're welcome Edit: Also change the code so that if the price hasn't dropped it goes back to checkPrice() and quits when it has dropped and send the mail
@ZeroPlayer1195 жыл бұрын
@@adventune375 can you run this on a web server ?
@adventune3755 жыл бұрын
@@ZeroPlayer119 I don't know. Haven't tested it. You maybe need to modify it a bit but it could be possible
@Jmonsky5 жыл бұрын
@@ZeroPlayer119 Yes, as long as the web server has python installed.
@dachs915 жыл бұрын
You could also just move the script to your windows startup repository (:\Users\Username\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup). I also made a schedule system for the script. I will post the link to my github if you want it.
@rupareddyvudumula77964 жыл бұрын
LOVED IT BRO...UR EXPLINATION IS LIT.......
@jasonabba39345 жыл бұрын
DISCOVERED YOUR CHANNEL LAST NIGHT! TOO GOOD.
@sreerammeka92385 жыл бұрын
I have a question, when I try to print using "print(page.status_code)", the result is 503 which means that the service is unavailable, what does it mean? Does it mean it is not available to handle our requests??
@rishabhraj24465 жыл бұрын
I tried but when I try to find something it returns none 😅
@leveltube105 жыл бұрын
Me also! What goes wrong?
@edinsonrequena10895 жыл бұрын
also to me and I tried everything
@jugginator43905 жыл бұрын
If you're printing a function, it'll likely return none there. None is returned when, well, nothing is returned haha. He's printing off something the has a value inside the function which is why it worked, but if you just print a function, it'll say none unless you return something. Kinda like, say I made a function def math(): x = 5 x 5. if I print(math()), it'll say none. If i add a return, like def math(): x = 5 x 5 return x, now the print will display 25.
@dunkboyys23615 жыл бұрын
Try typing requests.get(URL), instead of requests.get(URL, headers=headers). Line 9 on video.
@dansvanz925 жыл бұрын
@@dunkboyys2361 Thank you
@scorpion324 жыл бұрын
omg this is so useful, I'm gonna apply this to other things
@AakashBanodhe5 жыл бұрын
Of all the tutorials I have seen, this explained far better. Thanks.
@nikhili95594 жыл бұрын
Float --> includes decimal values as well :)
@MrPherez5 жыл бұрын
I like your project, keep sharing mind blowing projects champ
@thomasdejong2325 жыл бұрын
In my VS code i don't see an explanation of the functions as you have. At 5:01 typing "title = soup.find" How can I get this?
@yassineelb87355 жыл бұрын
guess python extension for intellisense
@DamienLaRocque5 жыл бұрын
You get that by installing the Python extension : marketplace.visualstudio.com/items?itemName=ms-python.python
@samanbalal8245 жыл бұрын
At 16:30 , why converted_price > 1.700 in two if statements?
@The_TermiGator5 жыл бұрын
he forgot he did it already and didn't notice
@Pcpiee5 жыл бұрын
just to be extra sure
@thebiziii5 жыл бұрын
By the way, these two conditions are not the same..
@youtu6er8605 жыл бұрын
@@thebiziii What do you mean that they are not the same. He changed the second one, that's true but only because he wanted to demonstrate the function if the condition is true. They are both the same
@thebiziii5 жыл бұрын
> is not the same as
@venkateshdas54224 жыл бұрын
No one has noticed the redundant "if" statement that has been used in the check price function. Other than that I found the video to be very useful and clean . Thanks for the upload!
@proyxm5 жыл бұрын
This is so cool! I'm using it to track System of a down tour data, it will create a link-file to the page on my desktop as soon as there are new tourdates scheduled. I don't even have to check emails. Thank you so much! Want to give multiple thumbs up!
@omonibash45565 жыл бұрын
I am facing this problem when I try to print title on 6:34 AttributeError: 'NoneType' object has no attribute 'get_text'
@Toopa885 жыл бұрын
Because you have to check the name of the "id". You can't simply copy his id because it returns None if it doesn't find anything. You are basically doing None.get_text()
@rayanaay59055 жыл бұрын
Same. Any advice?
@timetosleep80555 жыл бұрын
He is using the .de (germany) domain and not .com (international), if you use the german or uk domain it will work.
@ugurkoc30305 жыл бұрын
if soup2.find(id="productTitle").__len__() > 0: title = soup2.find(id= "productTitle").get_text() print(title.strip()) else: title = "No result" print(title)
@zaidangaming12885 жыл бұрын
Subscribed! Didn’t know about you, saw one video and now you’re my fav! Haha.
@aipython4 жыл бұрын
Hello, Do check out the cool Python project video from this playlist: kzbin.info/aero/PLBeeFF3JmXWCQh987TsdowLK5U8XwbSzw
@fun-ih5sc5 жыл бұрын
Awesome man , loved this. Just now executed my code. Thanks a lot for making this video keep making video like this
@rimini2014 жыл бұрын
Wahey - I just did this and it totally works. Now I need to use Python to automate other aspects of my life... thanks dude!!
@ahmadaminfarooq84955 жыл бұрын
Started from here and now Scrapy expert, Amazing video.
@obaidashurbaji92234 жыл бұрын
at min 5:45 i tried it and it gave me this (AttributeError: 'NoneType' object has no attribute 'get_text') what's the problem?
@godihateyoutube4 жыл бұрын
In the documentation for Beautiful Soup, it says that the find() method will return None if no element with the given id is found. Meaning, whatever you listed as the id was not found in the html content you pulled.
@noahsigel35294 жыл бұрын
@@godihateyoutube you cant use bs4 anymore
@keremozbakir80894 жыл бұрын
The solution is actually quite easy, html parser cant parse Amazon html very well just use html5lib instead or lxml my friend
@juliangeiler25154 жыл бұрын
it works but only every 4th or 5th time =( what can i do now?
@keremozbakir80894 жыл бұрын
@@juliangeiler2515 what's the error you get? I will try to help you if i can.
@abhinavdeep66285 жыл бұрын
Hey dude, this is 1st time I'm watching your video but loved it really I mean I'm in love with it. Yeah and subscribed it with notification bell so don't worry. See you soon.😍😍
@danielrubenacker82065 жыл бұрын
"it's not stopping! It will never stop, just like my mental state" lol, lmao. ;)
@1polyron15 жыл бұрын
Shit
@koveh5 жыл бұрын
Hello, I made the same code, but I have an error with .get_text() it sounds like ‘Nonetype’ object has no attribute ‘get_text’. How to solve?
@eshikagupta66163 жыл бұрын
I can't get over the way he's sitting😂😂.....I sit like that either when I know too much about how i'll be going ahead with the coding or I literally know nothing...BTW this project is super cool!!
@rishijoshi58085 жыл бұрын
Yo, great content bruh. Could you also share with us as to how do you research about those libraries you used in the video? Thanks very much!
@justincv5 жыл бұрын
Hey Rishi! You can have a look at www.tutorialspoint.com/python/python_modules.htm Specifically have a look at built-in modules :D Good luck
@3AgL3DeeJay5 жыл бұрын
14:45 how can you not see that you have the same if condition and send_mail() function just 3 lines above....???
@@HansPeter-gx9ew I'm using Ubuntu OS. I'm facing same issue.. I tried your suggestion but it doesn't work for me. Error : The code that caused this warning is on line 11 of the file scraper.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor. soup1 = BeautifulSoup(page.content, "html") scraper.py:12: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently. The code that caused this warning is on line 12 of the file scraper.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor. soup2 = BeautifulSoup(soup1.prettify(), "html") output : None
@jacobmoran31025 жыл бұрын
@@HansPeter-gx9ew Thank you! However, I got warning to specify a parser, so I used "lxml" instead of "html." Works as expected now.
@angelowolff71275 жыл бұрын
u can also just fetch all the html data, compare new and old data and if they are different, then a change was made on the page. then just pull whatever data was changed into a table. u can also use text logic like integer,integer.integer is most likely assumed as the price format, then u can redact all string results and u most likely will end up with a collection of changed prices. I think this way allows the only changing input to be the site address, but can be used on multiple sites that use the price format integer,integer.integer.
@angelowolff71275 жыл бұрын
or just use amazon api
@ad910am5 жыл бұрын
if soup.find returns None, what u have to add is: soup1 = BeautifulSoup(soup.prettify("utf-16"), "html.parser")
@danielratner4 жыл бұрын
Thank you
@raphaelzerah32804 жыл бұрын
still. not. working for me did amazon change something ?
@aoof67425 жыл бұрын
13:27 USE THE VARIABLE OH MY GOD.
@kamilmuza44175 жыл бұрын
if statement with parentheses? python zen: We don't do that here my friend.
@demeter17935 жыл бұрын
The while loop as well
@kamilmuza44175 жыл бұрын
Дмитрий Авдеев didn’t watch that long, as soon as i saw that, i just bailed.
@nauzetmartin3255 жыл бұрын
Do you not declare the conditional twice? thanks for your video!!
@rodrigoalvesvilela235 жыл бұрын
He did. saw it too xD
@HotShame04 жыл бұрын
We can use Regex to extract the price without specifying the elements, because what if the price by magic went down to the 10s or 100s. Here's how i would extract it ... x = re.findall("[0-9]+\.?[0-9]*", price) then use float(x) i never programmed in python but i learned it from java, and found that the library for regex in python is re.
@CarlosRodriguez-vg2ob4 жыл бұрын
Man this was FANTASTIC
@TheTrophieStars4 жыл бұрын
Seems as if amazon no longer easily allows scraping like this.
@mokafi74 жыл бұрын
oh is that why it wasnt working for me? i wasted 3 hours trying to get this working...
@pai644 жыл бұрын
@@mokafi7 F
@FRElHEIT4 жыл бұрын
I expected this and first searched the comments before wasting hours of my life. F
@reedheadable4 жыл бұрын
@@FRElHEIT I added a Referer to my header and it seem to bypass the web scraper block ex. Referer : "www.google.com"
@pytharian26604 жыл бұрын
Works for mw
@tylermcchesney23145 жыл бұрын
Anyone else have issues with the .get_text() request when he defined title and price?
@__-vq9mb5 жыл бұрын
Try importing: from django.utils.translation import gettext
@gamzaify4 жыл бұрын
Did you find a solution? Getting this as well
@kelvinmwongera73204 жыл бұрын
@@__-vq9mb exactly as you've typed it or what command should we put in the terminal?
@shafmairaj64935 жыл бұрын
i have written the same code like yours and i got "None" after executing the file help please!
@sibbonsshrestha34385 жыл бұрын
soup = BeautifulSoup(page.content, 'html.parser') soup1 = BeautifulSoup(soup.prettify(), "html.parser") title = soup1.find(id="productTitle") print(title) recommended by a guy earlier
@ennissg5 жыл бұрын
@@sibbonsshrestha3438 Thank You
@varunbhonsle81094 жыл бұрын
that part is written in JS so its technically not there.use selenium
@filippocerchi10834 жыл бұрын
@@sibbonsshrestha3438 I LOVE YOU.
@marioalfredo983 жыл бұрын
When you use request to get te page contents, I'd recomendd you to do it using an exception, because if your internet falls down your code will brake, so if you add an excepcion somethin like except ConnectionError:, then your program still works even if you don't have any internet. BTW, really good video mate, I've learned so much.
@happychuckprogramming60484 жыл бұрын
very nice video. Selenium based applications help in tracking amazon prices, ordering food, shopping automatically using python. Make our lives so much easier.
@ArchHyperion5 жыл бұрын
lol when you set the price to price[0:5], this is bad programming. always do a regex lol. I'm also wondering how the euro symbol disappears in that string splice. when you start at 0, it should get the first character which is the euro symbol right?
@yskhcl5 жыл бұрын
Or for this specific case, you can find the euro sign and split the string until it, I agree with you man
@ArchHyperion5 жыл бұрын
@@yskhcl i just find it strange lol.
@aravinda5134 жыл бұрын
I too had the same query!
@MostafaKhaled-c8q5 жыл бұрын
please more javascript tutorial
@FoxFollowSMMPanel5 жыл бұрын
احا عنينا
@ommandavia5 жыл бұрын
Hey there! Thanks a lot for sharing your knowledge. It helps a lot for students like me to stand apart. :)
@tuz68204 жыл бұрын
awesome video. i’m gonna use this as a base for practice and make a little web app out of it which allows the user to input an url himself :)
@igorstasenko91835 жыл бұрын
float takes its name from 'floating point number'. float is the way how you store numbers in memory, and surely you can represent 'whole numbers' like 5 using float
@leonardodicaterina76755 жыл бұрын
so... those hideous automatic mail bombing advertiser may have their internet security lowered? interesting
@cankarkadev92814 жыл бұрын
No probably not, you just need to lower your security level if you send mails from your local computer without having a physically real server. If you have one you can just write mail.send or something and the mail is going to be sent as well
@ziinx58993 жыл бұрын
Looks like Amazon updated their site. It keeps detecting me as a bot and gives me a different html.
@anshumanparekh36033 жыл бұрын
why does it not work anymore?? it just says none instead of price
@sola29436 ай бұрын
I ran into that problem too. I even changed the text to a-price-whole to reflect the page's current format. 🤷
@nabiha33583 жыл бұрын
You're honestly the best to learn coding from
@greaper31804 жыл бұрын
1:40 and i liked you already. Subscribed. I like how you talk about programming like it's some magic stuff.
@archerplayz13174 жыл бұрын
when ever i use .get text this comes up please help:Traceback (most recent call last): File "main.py", line 7, in title = soup.find(id="productTitle").get_text() AttributeError: 'NoneType' object has no attribute 'get_text'
@clank22694 жыл бұрын
try these out: soup = BeautifulSoup(page.content, "html5lib") (you need to install html5lib) if this doesnt work use New code: soup = BeautifulSoup(page.content, 'lxml')
@tinkug27984 жыл бұрын
Hi, i tried html5lib as well as lxml. Same error , could you please help.
@LaffyToffy4 жыл бұрын
@@tinkug2798 are you finding element by id or class? if you are using class use: title = soup.find("div", {"class": "_35KyD6"}).get_text()
@tinkug27984 жыл бұрын
@Ayush, hey ayush, i am finding by id just like it is shown in the video
@tinkug27984 жыл бұрын
Thanks Ayush. I think i got the issue it is varying from website to website, i tried on amazon.in same code worked perfectly fine. Amazon.com it is throwing this error .
@ronanpeter86575 жыл бұрын
could not convert string to float:(
@Jagddish5 жыл бұрын
Mine too! use single quotes converted_price < '1,700' as a string
@fadhlulfahmi51255 жыл бұрын
in my case, the output of price variabel is $1,700.00 or something like that,, so I make the code like this: converted_price = float(price[1:6].replace(",", ".")) this will return a float 1.700
@abbyboing5 жыл бұрын
@@fadhlulfahmi5125 Even I had to StackOverflow this stuff. Pretty confusing as str_replace() was not working properly but the . operator did the perfect job. You know why str_replace() didn't work? depreciated?
@fadhlulfahmi51255 жыл бұрын
@@abbyboing as far as i know, python use str.replace() not str_replace()
@abbyboing5 жыл бұрын
@@fadhlulfahmi5125 maybe str_replace() would've been some old function, as I did see alot of that on stack overflow.
@aniruddhagaikwad17473 жыл бұрын
Thanks for the Tutorial Dude. You have introduced web scraping to me. Keep up the good work. # below code is for converting price into float. string = price string = string.replace('₹','') string = string.replace('$','') string = string.replace(',','') converted_price = float(string[:-3])
@mohamedyusef91745 жыл бұрын
can you make an app that buys the camera automatically whenever it reach a certain price...is it possible?
@sevcandincel5 жыл бұрын
MOHAMED YUSEF i think you can make it whit selenium module. Its use in web automation.
@Andrei-rp3dz5 жыл бұрын
Yeah but it's better to use Selenium for that. That being said, Amazon might stop you from connecting if you use a headless browser, so try some stuff out.
@user-cd6vy2jg6f5 жыл бұрын
Andrei Lazar if it’s online there’s a way for it to be done. Amazon can do a lot to prevent it, but a determined coder can find away around it. Wether that be scraping the page for the CSRF token and sending that in the header or a hidden form value - its impossible To prevent a public page from being used by bots completely
@ryankraft98975 жыл бұрын
A friend of mine built a bot that did exactly that. He actually gave it full access to his PayPal credentials to purchase items. It went rogue and it bought some really weird items on its own. It bought a pink selfie stick, winter gloves, and some other totally useless stuff. Too funny.
@elmahdichaker12073 жыл бұрын
Best teacher ever 👍🏼👍🏼👍🏼
@MrPaPaYa863 жыл бұрын
I would have the check_price func return a boolean rather than calling the second function, makes things more clear and the project helps with scalability