Python Requests Tutorial: Request Web Pages, Download Images, POST Data, Read JSON, and More

Поділитися
Вставка
  • Опубліковано 3 жов 2024
  • In this Python Programming Tutorial, we will be learning how to use the Requests library. The Requests library allows us to send HTTP requests and interact with web pages. We will be learning how to grab the source code of a site, download images, POST form data to routes, read JSON responses, perform authentication, and more. Let's get started...
    BeautifulSoup Tutorial - • Python Tutorial: Web S...
    File Objects Tutorial - • Python Tutorial: File ...
    ✅ Support My Channel Through Patreon:
    / coreyms
    ✅ Become a Channel Member:
    / @coreyms
    ✅ One-Time Contribution Through PayPal:
    goo.gl/649HFY
    ✅ Cryptocurrency Donations:
    Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
    Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
    Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
    ✅ Corey's Public Amazon Wishlist
    a.co/inIyro1
    ✅ Equipment I Use and Books I Recommend:
    www.amazon.com...
    ▶️ You Can Find Me On:
    My Website - coreyms.com/
    My Second Channel - / coreymschafer
    Facebook - / coreymschafer
    Twitter - / coreymschafer
    Instagram - / coreymschafer
    #Python #Requests

КОМЕНТАРІ • 512

  • @coreyms
    @coreyms  5 років тому +332

    My next video will be a real-world example of a script I wrote to monitor my personal website. We'll use the Request library to monitor the site, and if it is down then we will learn how to send an email and automatically restart the server. I hope everyone finds this useful! Hope you're having a great week!

    • @premjilla8820
      @premjilla8820 5 років тому +9

      can you please make tutorial o scraping twitter data using tweepy?

    • @coreyms
      @coreyms  5 років тому +28

      That's on my list of topics to cover, but I have some data science videos I'm trying to put together first. But yes, I definitely will at some point

    • @swadhikarc7858
      @swadhikarc7858 5 років тому +3

      Awesome idea. Thought that would be a great tutorial to see you teaching how to monitor a website in a candid way

    • @tnhoang088
      @tnhoang088 5 років тому +2

      @@coreyms Need more data science, computer vision or even Javascript videos. Your lecture is so good but do not upload all the series at the same time like the django, flask before. It's so overwhelming. And if you can, I slightly recommend that you should make a series about Javascript, Nodejs or something related to js. I think it's much more applicable than data science or AI ... Just a suggestion ;)
      Always appreciate your way of teaching

    • @sujildevkota
      @sujildevkota 5 років тому

      Can you make a video to run python script in the background and display message and progress bar in the web page using Django

  • @AlexBerkk
    @AlexBerkk 5 років тому +367

    That's it! I'm disabling my adblock for your channel!

    • @deus5215
      @deus5215 4 роки тому +1

      @yeeLix Felt that

    • @paulthedanger
      @paulthedanger 4 роки тому +1

      @ً ok hackerr

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

      @ً check out privacy badger

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

      What a gentleman

    • @rodricbr
      @rodricbr 3 роки тому +5

      I'm disabling my brave shields for this guy

  • @NaderTaghinia
    @NaderTaghinia 5 років тому +100

    09:57 " I never understand how some of these people are so productive and..."
    Since, I started watching your channel I have been thinking the exact same thing about you Mr. Schafer. Honestly, I could never understand how you could author so many impeccable videos on programming so fluently. You are giving so much to people like me. Thank you from the bottom of my heart :)

    • @coreyms
      @coreyms  5 років тому +23

      Oh wow. Thanks so much, Nader. I really appreciate the kind words :)

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

      The same. I stopped video to write something like this. Corey! I watched many of your videos but I am still in doubt how you can be so humble, knowledgeable, and productive. You are just incredible. Along side of technology, I am learning morality. Thanks

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

    No matter how much I know or who I start learning from, I always end up back to Corey for some reason. Clear and concise!

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

    I have wasted my money on a python course on Udemy I've regretted to this day, and this guy spreading his knowledge for Free, such an awesome guy you are.. THANK YOU!!

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

      I’ve done that before

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

      I also want to start with Python. Given the fact that it's a four year old series, is it still enough ?

  • @rahulreddy6541
    @rahulreddy6541 4 роки тому +24

    You have got passion in your voice which is helping people like me to learn programming in a much fun way. Love you for what you are. love you 3000.

  • @misskay007
    @misskay007 5 років тому +16

    Harvard should hire you. I learned so much from watching your videos. Much more through than than CS50 course in web development(although it is a great series). Thank you, your hard work is very much appreciated. I will be donating and sharing.

  • @cyberguygame9096
    @cyberguygame9096 4 роки тому +1

    Normally I'm the guy that is getting aggressive because the guy in the tutorial video doesn't tell what I want to know, but THIS -THIS IS DAMN GOOD.

  • @timtudosa2519
    @timtudosa2519 4 роки тому +33

    You will reach one million subscribers soon Corey. Your videos are so detailed and and easy to follow through. I now understand requests. Thanks for the effort in making these videos!

  • @archstampton5910
    @archstampton5910 5 років тому +7

    Probably one of the more valuable UA-cam video I have ever seen, as far as I am concerned.

  • @pranaybure2651
    @pranaybure2651 5 років тому +26

    Excellent insight on Requests, Corey!
    Requests library is my goto tool when APIs aren't working as expected.
    I recently used Requests(Sessions) in a script to mimic browser activities for a web portal as APIs had issues with patch fixes.
    Understanding browser components with Chrome Dev Tools in conjunction with Requests was really helpful to understand how requests attribute viz. Headers, Form-Data, Query-string params are assembled.

  • @muralimohan807
    @muralimohan807 5 років тому +24

    Corey you are the best trainer or develper for me as when i see your videos ill get both new things and the things in my mind that i wish to ask you but you answer them in your video itself. so you are trainer and develper for me.keep the good work cheers.

  • @andonglin8900
    @andonglin8900 5 років тому +8

    WOW, the 100th video in your MARVELOUS Python tutorial series with my 100th thumbs up. Thank u Corey, you are truly amazing!

  • @sevenessie
    @sevenessie 5 років тому +17

    Hey Corey, just wanted to tell you what I realized recently.
    Whenever I'm reading a tutorial or some explanations in python/web dev area, I read it with your voice :D.
    Thanks for the great work and please don't stop :)

    • @alan-j
      @alan-j 5 років тому +1

      Yes, I would say coreyms is the best place to learn python in the whole of youtube network..
      Please dont stop this good work..
      HATS OFF TO U..

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

    Hello Corey, I'm Brazilian and your video helped me a lot with my project! Thanks for the class! 👊

  • @victoraugusto2224
    @victoraugusto2224 4 роки тому +1

    thanks man, im currently working in a project for a job application, your explanation saved my life

  • @RajPatelMansuria
    @RajPatelMansuria 4 роки тому +4

    You are awesome, the way you explain stuff with such calmness and speed is just out of the world. Thanks you again for posting great stuff 👏👏👏

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

    This is called something left behind when we move ahead...Good work Corey...

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

    The best channel, finally ! I have found all basics that I've missed before, and I regret to not find it long time a go, thank u very much.

  • @sudarsandm
    @sudarsandm 5 років тому +3

    Your video is a time saver. The information which we need to process from more than one blog or resource is presented elegantly and beautifully to us. Thank you Corey.

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

    10:06 dude, welcome to the club. Your videos alone make most of us feel the same way so I can only imagine if these people from your perspective are another step up in productive... then I'm completely puzzled! Anyway, thanks for a great video Corey!

  • @dan-3268
    @dan-3268 5 років тому +2

    Ok, Corey... Corey-Corey-Corey.....*ominous silence"
    You are the Man. Hands down the most well-put and thought through videos on Python I've seen on UA-cam.
    Much appreciated! I thank thee for thy work for tis magnificent

  • @narendrar9940
    @narendrar9940 5 років тому +5

    Hi Corey, Your videos have become my one source of all the information i need on python, your videos are simple and just great!, thank you very much.

  • @iadorepop
    @iadorepop 5 років тому +12

    believe me !! i was so waiting for this 💓

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

    Corey, your name is right up there in the list of people who are so productive and helpful. Your videos are just perfect for someone like me learning the ABCs of Python. Searched and listened to scores of videos but your videos are just perfect! no more no less. Your videos do not overwhelm someone like me. Am loving every bit of them. Just want to let you know that you are awesome!

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

    I was struggling a lot with requests. but now, I'm clear with it. Thanks Corey!! NO words to thank you. :)

  • @robinharris4706
    @robinharris4706 5 років тому +6

    Great tutorial Corey. Really like your stuff - thank you for covering the material at a brisk pace. Loads of excellent, well presented content without having to listen to slow tedious simplifications. Awesome!

  • @thengakola6217
    @thengakola6217 4 роки тому

    That was one of the few clean videos on the entire internet.........

  • @silverzero9524
    @silverzero9524 5 років тому +1

    i wanted to get info from site but was stuck so wrote some bad code that doesnt help me much but works
    and now u post this
    time to modify my code :)

  • @adamgdev
    @adamgdev 4 роки тому +1

    You fucking killed it again! So precises and easy to understand AND had some good random nuggets in there. (HTTP request code meanings and httpbin). You're the man! Keep it up!!!

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

    Excellent delivery Corey... the best!!

  • @juanbomfim22
    @juanbomfim22 4 роки тому +32

    I'm crying inside cause that's exactly what I was looking for

    • @Seiseary
      @Seiseary 4 роки тому +1

      hahahaah

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

      Damn true bro
      ... I was exactly looking for same

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

      I’ve never related more to a UA-cam comment

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

    Sir yours video is much more informative and is in more detail compared to others

  • @mrj1997
    @mrj1997 5 років тому +6

    Please teach everything ! your videos are fantastic.Thanks Corey

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

    This is a great video. I plan to test its examples within python. The only thing I missed was the Patch command.

  • @ihalil95
    @ihalil95 5 років тому +2

    I am really looking forward to seeing a video about threading. I hope you will make it as well! Thanks for great tutorials even better than paid courses around in my opinion! I'd rather support your channel instead of paying for less quality courses.

  • @chaitanyakhambete
    @chaitanyakhambete 5 років тому +2

    awesome work bro... making simpler stuff more simpler keep it up

  • @Bergamoism
    @Bergamoism 5 років тому +4

    Great job on explaining this! Your tutorials are to the point, clear and cover everything we need to know. Every video takes me to the next level.

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

    Lol your the first guy I look for when I need a tutorial. Great video as always!

  • @krishnakuraku6853
    @krishnakuraku6853 5 років тому +1

    looking forward for more videos like this ..pleas post more videos..you are the best tutor in python

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

    Thank God Corey has a requests tutorial

  • @ahmadabzakh2343
    @ahmadabzakh2343 5 років тому +1

    Hello Corey,, have been following you for quiet a while now,, really helpful in overall understanding of the subject in hands,, however, this is the first clip where I don't understand what's happening exactly, and obviously it's my problem, so wanted to ask about what prerequisites are needed in order to follow along in the video,
    again man many thanks for the effort put here,, you are one of a kind

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

    Corey fam gonna be 1 million.. 💚
    Cheers 🥂

  • @amitbajpai6265
    @amitbajpai6265 5 років тому +10

    I been waiting for this long long time ago thank you Corey

  • @henriquepigozzo4707
    @henriquepigozzo4707 5 років тому +1

    The timeout param is amazing. Thanks!

  • @ravindersanjay
    @ravindersanjay 4 роки тому +1

    this video is worth watching. full of knowledge

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

    If you send a GET request to Merriam Webster online of "BEAST MODE" you will get back a png of Corey!!! 😂 Super job Corey, your videos are always uber understandable even to a neophyte such as myself!!!

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

    Thanks, for such an awesome high quality tutorial 😀 Very clear and quick to the point!

  • @bgable7707
    @bgable7707 4 роки тому

    Concise, clear, explanation and examples. Always hitting the key points with any fluff, thanks!!!

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

    The best tutorial I've ever seen

  • @MusicGameFinatic999
    @MusicGameFinatic999 4 роки тому +1

    You are the man! You very much. Very well explained.

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

    whenever I am challenged while working with python, then my mind recalls Corely.

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

    Do u remember Miller's planet in the Interstellar movie?
    There, time used to move much slower than on Earth. Well, Corey's videos are the opposite: 20 minutes of contents here are the equivalent of 1 month spent studying hard on a python library ☺️☺️

  • @karthikl4692
    @karthikl4692 5 років тому +2

    Thanks Corey right video at right time

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

    This was a good video. I am still struggling with using session objects though. Would love an in-depth on that. Happy new year! Stay safe

  • @j.d.3890
    @j.d.3890 5 років тому

    Hey Corey, thanks for this guide.
    In work sometimes `allow_redirects=False` as request param is helpful as well.
    Also if your request resulted in several redirects (which is also quite usual), request.history will return all request objects which have happened.

  • @falconX5000
    @falconX5000 5 років тому +1

    Great work pal!!!!!! Looking forward to your next video.

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

    Absolutely super, well done, very well paced. Thank you for this, learned a lot.

  • @huy3986
    @huy3986 4 роки тому

    I really love your videos. Thank you so much and wish you're always happy.

  • @jenmanzella1948
    @jenmanzella1948 4 роки тому

    Your tutorials are FANTASTIC! Thank you

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

    😍😍😍 hey Corey… u are just the best 🥳

  • @mouradbarakat123
    @mouradbarakat123 5 років тому +1

    This video is just in time for me! Thank You!

  • @willumdgork
    @willumdgork 4 роки тому

    Outstanding tutorial! Thanks for the coaching and for pointing out the httpbin tool!!!

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

    The best on youtube. Sublime

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

    this guy has videos on everything

  • @daegudude1048
    @daegudude1048 5 років тому +2

    Like and thumbs up before watching it!!👍👍

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

    Gratz on your 1mil subs! Well deserved and surprised more haven't sub'd!

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

    Best tutorial for requests

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

    thanks alot you saved my day .... i have only mistake in post request thanks alot

  • @yolberpabon4973
    @yolberpabon4973 4 роки тому

    Genial Corey, me gusto el video y era lo que buscaba, una explicación rápida y clara de que es requests y ademas lo haces con profesionalidad (+sub)

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

    You explain things the simplist and the best, i still cant get any of this stuff to work.

  • @jeffgalef121
    @jeffgalef121 4 роки тому +1

    Fantastic video. Thank you for your hard work.

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

    Thanks for the video. I am a total beginner to APIs. Would be good if you could suggest videos.

  • @robinhood3841
    @robinhood3841 5 років тому +2

    Thanks for the video we can now perform Dos attack
    XD am just kidding its a good method to use keep it up buddy

  • @parthparadkar1021
    @parthparadkar1021 5 років тому +1

    Thank you so much for this video!! Happy to have learnt something new today. Keep 'em coming! :D

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

    Excellent explanation!

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

    Thank you so much Corey for your time!

  • @Александр-р3э3м
    @Александр-р3э3м 4 роки тому +1

    Thank you so much, Corey! I like your videos a lot!

  • @call-me-poor9313
    @call-me-poor9313 4 роки тому

    This Video is so helpful. I can not thank you enough

  • @Jo-id9zm
    @Jo-id9zm 5 років тому +1

    Thanks once again for some quality content, man!

  • @j.n.y790
    @j.n.y790 3 роки тому

    FANTASTIC TUTORTIAL! well done

  • @theknightoftech6283
    @theknightoftech6283 5 років тому +1

    Why didn't somebody tell me about the dir float(I hope that is the right word. I am still learning) when I as first starting python? That is the most useful thing!

  • @stonecoldcold2941
    @stonecoldcold2941 4 роки тому +1

    Awesome Tutorial!

  • @alan-j
    @alan-j 5 років тому +2

    @corey This is an awesome video on requests.. If anybody asks me what is the best place to learn python, i will directly point them to your channel.
    Can you also cover some indepth topics of this "requests" module?

  • @talhaamir9023
    @talhaamir9023 4 роки тому +1

    great buddy!! keep it up!!
    this was highly knowledgeable.:)

  • @JoeVariousInterest
    @JoeVariousInterest 4 роки тому

    Great video. You covered exactly what I needed!

  • @olha_
    @olha_ 5 років тому +2

    Great video as usual Corey! Please do more videos on Django and Rest Framework, thanks!

  • @wanderer-1986
    @wanderer-1986 5 років тому

    Awesome video! Thanks for posting this. Easy to follow your examples. Thank you

  • @manishadwani386
    @manishadwani386 5 років тому

    Awesome video tutorial as always Corey. Believe me I'm writing this comment after watching the entire video and it's great, even though I knew requests I still learned something new, So Thank you. One more thing, I noticed there are not a lot of asynchronous python video tutorials out there. I would love it if you could make a video on explaining different tactics and techniques used, to make your code asynchronous and an asyncio tutorial elaborating async/awaits functions.
    Anyways think about my request and thanks again for this great video.

    • @coreyms
      @coreyms  5 років тому

      I definitely want to do that. I've been trying to plan some videos like that, but it is a very hard topic to teach well. Hopefully I'll get something together that can explain it.

    • @manishadwani386
      @manishadwani386 5 років тому

      @@coreyms awesome man, it's great that you're trying to put something together. Thanks

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

    Amazing tutorial. Kudos for making it. It was really awesome.

  • @RajanKumar-lv7ve
    @RajanKumar-lv7ve 5 років тому +1

    oh, i needed this one really, Thanks Corey :)

  • @MongooseTacticool
    @MongooseTacticool 4 роки тому +1

    Corey, you're the best :)

  • @supriyochowdhury3546
    @supriyochowdhury3546 4 роки тому

    No words can define Corey

  • @SandwichMitGurke
    @SandwichMitGurke 5 років тому +1

    dude this video is so awesome!!

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

    Excellent video go directly to the point

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

    Sir, I love your video and the clear voice put into doing the videos. Please let me know if you have any python data structure and algorithm courses I can buy. Thanks

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

    Hey Corey, great video! You actually motivated me to get started with my own project, which requires me to request data that is too big to transfer. I was wondering if you already have the intention of making a video on what to do when your POST request is not accepted due to size limitations on the server side and how to come around that issue? Thanks for all the great material you have created so far!

  • @andreiolegovich5971
    @andreiolegovich5971 4 роки тому

    Thank you for creating this tutorial!

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

    jfc, i finally found this... THANK YOU!!!!

  • @busimoses8095
    @busimoses8095 5 років тому +1

    You're AMAZING, a lifesaver