Тёмный

Website login using requests library in Python 

Indian Pythonista
Подписаться 33 тыс.
Просмотров 178 тыс.
50% 1

IN this video, learn the step by step procedure to login to a website using requests library in Python.
Example code here: gist.github.com/nikhilkumarsi...
Intro to web scraping:
indianpythonista.wordpress.co...
Intro to requests library:
indianpythonista.wordpress.co...
------------------------------------------------------------
Explore my tutorials: nikhilkumarsingh.github.io/tu...
More awesome topics covered here:
WhatsApp Bot using Twilio and Python : tinyurl.com/y9n9ott5
Serverless Rest API using AWS and Python : tinyurl.com/y8yg4vem
Creating Chat Application using Flask, Socket.IO & mongoDB : tinyurl.com/y8kbn4xu
Curses in Python : tinyurl.com/y8ws3x4l
Discovering Hidden APIs : tinyurl.com/y7sdegoq
RegEx in Python : tinyurl.com/y84cnuns
Python for Data Science : tinyurl.com/yd7x6j5e
Introduction to Pandas : tinyurl.com/ycr4qytt
Introduction to Matplotlib : tinyurl.com/y8caem3r
Introduction to Numpy : tinyurl.com/yc8uhtn9
Functional Programming in Python : tinyurl.com/ybubzum6
Python Package Publishing : tinyurl.com/ya2fn3wb
Multithreading in Python : tinyurl.com/ycnummb8
Multiprocessing in Python : tinyurl.com/y8qkjqtx
Parallel Programming in Python : tinyurl.com/yakl5udt
Concurrent Programming in Python : tinyurl.com/y9ppkkhc
Dataclasses in Python : tinyurl.com/y8zfqleq
Exploring RU-vid Data API : tinyurl.com/y7jhs8rm
Just For Fun : tinyurl.com/y9on8gb5
Exploring AWS : tinyurl.com/ydxmhhz9
Jupyter Notebook (Tips, Tricks and Hacks) : tinyurl.com/y8qdhcrp
Decorators in Python : tinyurl.com/y7ghraa9
Inside Python : tinyurl.com/yd8xqbjj
Exploring datetime : tinyurl.com/y96jzylm
Collections in Python : tinyurl.com/ybxltgvk
Networking : tinyurl.com/y97eroql
Computer Vision for noobs : tinyurl.com/y8pxz436
Python for web : tinyurl.com/y829py3g
Awesome Linux Terminal : tinyurl.com/y8no3zso
Intermediate Python : tinyurl.com/yasmecaw
Tips, tricks, hacks and APIs : tinyurl.com/y9xqzzl4
Optical Character Recognition : tinyurl.com/ybt3to6q
Facebook Messenger Bot Tutorial : tinyurl.com/y9wvjc9g
Facebook: / indianpythonista
Github: www.github.com/nikhilkumarsingh
Twitter: / nikhilksingh97
------------------------------------------------------------
#python #requests #logging

Опубликовано:

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 293   
@eerik6571
@eerik6571 3 года назад
By this time my code consists of: 25% Stack overflow scripts, 10% my own work, 40% people sharing ideas on RU-vid and 25% pure luck (no one know how or why the code works but it does!). Thank you so much for this video!
@alexanderjack5937
@alexanderjack5937 3 года назад
LOL
@kapilsonyt
@kapilsonyt 2 года назад
Relatable 😃
@HardeepSingh-sm5pc
@HardeepSingh-sm5pc 4 года назад
Dude, This is like the most underrated Python Programming channel I have ever seen. subscribers = 0 while True: subscribers+=100 print("Nice Content"*99999)
@clurdy649
@clurdy649 3 года назад
LOL
@simthegreat5690
@simthegreat5690 2 года назад
it will never print "Nice Content"*99999 since you have an infinite loop
@4kumetsu
@4kumetsu 2 года назад
@@simthegreat5690 loool
@noahbroyles8828
@noahbroyles8828 4 года назад
Very nice! Just keep in mind that different sites use different tokens to login with. You may need to play around in the inspector for a bit until you find it.
@coucal
@coucal 4 года назад
Super cool, I was struggling to login into an ASP login, with your neat steps and some tricks I am able to get in now :)
@SirPottsalot
@SirPottsalot 4 года назад
After hours of searching for a way to edit online forms through a python script. (I'm a noob at requests) This video gave me all the tools I needed in ~12 mins. Wish I had found this earlier...
@vuinx
@vuinx 4 года назад
very clear instructions and explanation. great job and thanks for the tutorial
@manfredsaxshar8939
@manfredsaxshar8939 5 лет назад
Really great video. Thank you pretty much.
@PatrykKodym
@PatrykKodym 5 лет назад
Thank you! Useful stuff :)
@cristif92
@cristif92 4 года назад
Thank you ! Now I get it with the options like headers and login_data ... and also where I get the login_data dictionary values ! Thanks man ! :)
@iamakifislam
@iamakifislam 4 года назад
Before start watching, I want to say thank you !
@arminhejazian5306
@arminhejazian5306 4 года назад
Finally found what i was looking for ...thank you for high quality content
@swagatjena6888
@swagatjena6888 4 года назад
Thank you. This helped a lot!
@hkbtdragdragfly542
@hkbtdragdragfly542 5 лет назад
Awesome video! Keep up the great work guy!
@akashmaurya1996
@akashmaurya1996 2 года назад
BestT 12 mins of Educational video ever!!!
@pczaomyworld777
@pczaomyworld777 4 года назад
I followed the instructions and it really worked
@markscheck
@markscheck 4 года назад
Great video, I learned alot! Keep up the good work!
@rogerwprice
@rogerwprice 5 лет назад
Super useful and well explained - thanks!
@ViridianMarmot
@ViridianMarmot 5 лет назад
Great tutorial, thanks a mil man!
@arnau02
@arnau02 3 года назад
Thank you very much indeed, this video has helped me doing exactlly what I wanted, and with 0 errors. Now that I understand it thanks to you, I can keep doing my work. You're great :D
@alexpujolcomet976
@alexpujolcomet976 4 года назад
You're the best!!!
@CasperWest
@CasperWest Год назад
If I wanted to make a post request, do I need to main website or the request url link in the dev tools?
@hyllervianna
@hyllervianna 4 года назад
THANK YOU !! U saved my life!
@MillPillGames
@MillPillGames Год назад
hey and is there anyway to parse javascript values ? cuz there is a needed header that i need to send on the post method , how can i get this header value ( knowing that its calculated in a js FILE ) from what i have seen in inspector
@moegreen4395
@moegreen4395 5 лет назад
Thanks for the video ! :) I have an additional question. I wish to get the redirected url, that is in Web Inspector under the name "location". Yet I cannot see it anywhere in the soup. From where can I get it ?
@darklionking3341
@darklionking3341 5 лет назад
Thanks for this tutorial, good work.
@Waldo8226
@Waldo8226 4 года назад
Thanks for tutorial, helped my project!
@VicoSurge
@VicoSurge 2 года назад
Exactly what I needed, thanks for the video!
@RNBnewsIndia
@RNBnewsIndia 4 года назад
Bro I have m3u8 which is encrypted I have key But I don't know how to decrypt the file ?
@zzbaz2000
@zzbaz2000 4 года назад
Awesome, thank you so much!
5 лет назад
amazing video, it looks very simple, thanks man
@mariodouglasa.cabral8842
@mariodouglasa.cabral8842 4 года назад
You're the best!!! Thank you very much
@igorbarros9620
@igorbarros9620 4 года назад
Great content, sir. Thank you!
@dayofagbenro8476
@dayofagbenro8476 4 года назад
THANK YOU FOR THIS VIDEO!
@dizz9719
@dizz9719 4 года назад
Thank you! It really helped me with my poject
@elivakrat5654
@elivakrat5654 5 лет назад
Thank you! Great Video!
@anota
@anota Год назад
Thank you so much! This helped me a lot, with this explanation I was able to submit in multi page forms. Greetings from Brasil! ⭐⭐
@InteligenciadeNegocios
@InteligenciadeNegocios 4 года назад
i cannot find the form_build... how can we solve that? or what can we do? help please!
@ujjwalrustagi8690
@ujjwalrustagi8690 3 года назад
The video that I was looking for. Thanks.😊
@PrasanthChandraLingala
@PrasanthChandraLingala 4 года назад
Thank you for nice explanation.
@adityakulkarni3396
@adityakulkarni3396 4 года назад
Hey, i have a python script that fetches attendance for which i use selenium for logging in and everything works pretty fine, but my question is that after ruuning the script it automatically opens up the browser and does the login and then clicks on the specified link to fetch the attendence !...............What to do if i want to do all of this behind the scene without the browser actually been showing up?
@nilacof
@nilacof 5 лет назад
good video and explanation! thanks!
@michelezanotti9083
@michelezanotti9083 4 года назад
And what if in my html there are more then one form_key (because there are more actions (login, register, newsletter)? The key are in the same
@conor4289
@conor4289 4 года назад
Very helpful. Thank you!
@DAWE12100
@DAWE12100 4 года назад
OMG! Thank you soooo much!!!!
@mimidhr
@mimidhr 5 лет назад
Great, thanks a lot from Morocco
@MiRaje8086
@MiRaje8086 5 лет назад
Hey man I tried this but the website I'm trying has 2 POST requests. One to login, and one to validate with a unique token. The problem is when I try to parse the URL it's using to 'validate' it says error parsing body. So I can get the unique token value. Any tips?
@MrTaken-tl4bw
@MrTaken-tl4bw 2 года назад
great video, very helpful to scrape website protected with login
@she.....
@she..... 5 лет назад
Great video. I was trying to do something similar in java without using selenium. This helps.
@swadhikarc7858
@swadhikarc7858 5 лет назад
Still using Java at this modern age for web scraping?
@sandipbamrel2087
@sandipbamrel2087 5 лет назад
wow bro i learned good thing today
@bilalghelima3666
@bilalghelima3666 3 года назад
When I run the code, it just prints out thelogin page, why is this happpening
@monicavigoni3253
@monicavigoni3253 4 года назад
hi, the website i am trying to login does not show the csrf. only when i inspect i can see it. but then it is omitted. any idea how to get it?
@dhyanpatelbitspilanitotamu1520
Thank You Nikhil for the video. I am facing an issue while using this code to login into a microsoft page, specifically Sharepoint page which is a kind of company's internal site. Also, when I inspect on the sharepoint homepage to look for user-agent and form_build_id, I can find the user-agent, but cannot find the form_build_id information. There is no section of "Form Data" under the Network when I inspect. Is it because the sharepoint login is "Connected to Windows"? Can you please help me out here?
@Reedmax
@Reedmax 4 года назад
I just ask if i send request and the web site have 504 bad getaway time out , the request success or not please
@ryanthurston1305
@ryanthurston1305 4 года назад
Dude, thank you!
@kursdragon
@kursdragon 4 года назад
Hi I'm trying to do this and I'm looking at a website that I'm trying to login, but when I submit my login information and click the "login" button I don't get a "post" notification, just a "get" request which is called app.js, anyone know what to do in this situation?
@ilkersagkaya4568
@ilkersagkaya4568 3 года назад
I can not find form build id in my login form data headers or anything seems like it with a different header name. What can I do about it?
@lucaslau8379
@lucaslau8379 5 лет назад
I don't see anything about login data from indexPage.action, only encrypted cookies, what should I do?
@_xylotus_
@_xylotus_ 4 года назад
I want to login into facebook as a sample. And when I click the "login" button I always find the "www.facebook.com" network process but Its an "get" request with the code "200". I cant seem to find a post request with the categorie "Form Data" with password and username in it (etc.)
@rs-tarxvfz
@rs-tarxvfz 4 года назад
Hey dude, do you have something for SAML v2 based Single Sign On?
@harinath_mishra
@harinath_mishra 3 года назад
There is csfr token also now a day how to get that for login_data pls tell
@lowerpass2000
@lowerpass2000 4 года назад
Dude you're awesome! Ty
@michelleliew7341
@michelleliew7341 4 года назад
For those who cannot login access to the url, there's a new item under 'Form Data', which is 'csrfToken'. You'll need to include it to the 'login_data' using the same method searching for 'form_build_id'. Code for 'csrfToken': login_data['csrfToken'] = soup.find('input', attrs={'name': 'csrfToken'})['value']
@ashwinis.chavan4598
@ashwinis.chavan4598 4 года назад
Hello Michelle, were you able to login to the same site after card token addition? I am getting 200 response but the username and password fields are empty
@michelleliew7341
@michelleliew7341 4 года назад
@@ashwinis.chavan4598 Hi, I suppose you need to have an account of the website beforehand. Then, you shall use your password and username in the code.
@yusuferarslan3851
@yusuferarslan3851 4 года назад
The website that i want to try to scrap, don't have form data area. So i can't get formbuild id name etc. Can u help about it ?
@Daffo
@Daffo 4 года назад
can someone help me trying to do this for slamjamsocialism but can't find the login request?
@suhaasvellanki8504
@suhaasvellanki8504 4 года назад
um can someone help me out here? I copied the video word for word but the error 'TypeError: 'NoneType' object is not callable' is showing up for this line: login_data['form_build_id']=soup.find('input',attrs={'name':'form_build_id'})['value'] I have no fricken idea as to why this is happening.
@qwertyx141
@qwertyx141 5 лет назад
thank you very much
@Brainneeds
@Brainneeds 5 лет назад
you earned a sub , thank bhai
@cshekar100
@cshekar100 4 года назад
Thank you so much it is very helpful ...nikhil
@pedropancho3128
@pedropancho3128 5 лет назад
Very useful. Thanks
@vielmond1840
@vielmond1840 2 года назад
Very good. Thanks!
@tuskiie
@tuskiie 4 года назад
what should i do if there is nothing called 'form_build_id' and there is no value?
@fordlab22
@fordlab22 4 года назад
skip and watch another video
@shekh4r
@shekh4r 4 года назад
Check post request
@EdwinEnriquezMX
@EdwinEnriquezMX 4 года назад
@K H check if your site have something like a token, in the request headerss.
@hemantgore2567
@hemantgore2567 4 года назад
I tried this and got SSL exception requests.exceptions.SSLError: HTTPSConnectionPool(host='mwhlvcmut2.corp.amdocs.com', port=28501): Max retries exceeded with url: /B2B (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1056)'))) can you please help me here?
@34_shivamsingh68
@34_shivamsingh68 5 лет назад
Pure Gold !!!
@bkshows9141
@bkshows9141 4 года назад
Very helpful video thanks
@OverloadedSlime
@OverloadedSlime 4 года назад
Awesome man!!!
@arunmpkumar
@arunmpkumar 4 года назад
Very useful video; thank you (y)
@Pablo-wy1ui
@Pablo-wy1ui 3 года назад
Thank you so much!!!
@pratyakshyt
@pratyakshyt 4 года назад
hi sir im not able to log in to my website.. actually it is a website for our college academics, which is acccesebile through a vpn, the get request is working fine but post request fails .. please help asap
@rbk00006
@rbk00006 4 года назад
hey dude,im getting the 405 Not Allowed error even after passing the headers..plz help
@jake2663
@jake2663 Год назад
Very helpful thank you
@evil_beast_z
@evil_beast_z 2 года назад
Can u help me.. How to inspect a website network requests in android? To get form data
@mrjack7975
@mrjack7975 4 года назад
Can you help me with this ? login_data['csrfToken'] = soup.find('input', attrs={'name' : 'csrfToken'})['value'] TypeError: 'NoneType' object has no attribute '__getitem__
@TheHitessh
@TheHitessh 4 года назад
We have something called requests.auth, in which we have a class named HTTPBasicAuth which serves the same purpose. Is it possible for you to explain that?
@cuongnguyenthe6593
@cuongnguyenthe6593 5 лет назад
bro can you help me. my response is 405 error: Method is not allowed.
@Errorcode-hq5wg
@Errorcode-hq5wg 4 года назад
Thank you so much
@bakanayi
@bakanayi 3 года назад
Hey cool tutorial. One question, the website i am trying to do this on has an encrypted password in the form data. How can we go about doing it?
@pronoyghosh2803
@pronoyghosh2803 3 года назад
did u try passing the encrypted password as the value for password key?
@devarshsanghvi9315
@devarshsanghvi9315 2 года назад
Thanks for the efforts
@hperezcu
@hperezcu 4 года назад
your example work , I tried with another website in our intranet and I am unable to login,. I just replace the url (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
@angelvargas9681
@angelvargas9681 4 года назад
How can I do if the developer tool does not show me form data? Please help me with this, thanks in advance
@barkhasharma8294
@barkhasharma8294 4 года назад
why it is post request?? I have tried one website and login there it was showing me get request with status code 200???????????
@fantasticprajwal7442
@fantasticprajwal7442 3 года назад
How we can scrap the website where SAML authentication is there
@thestonedgamerz8533
@thestonedgamerz8533 4 года назад
I have used the same thing exactly but my problem is different. After Authentication, there is a long loading page then using content.text i get tags of that loading page html instead of one after the loading is done
@alfiyansubair7617
@alfiyansubair7617 3 года назад
i want to login to a website using requests but the login form is an can you explain me how?
@paulblack2649
@paulblack2649 5 лет назад
Great tutorial
@utkarshkulshrestha6783
@utkarshkulshrestha6783 5 лет назад
Help please. In your line number 19 in git code its showing "TypeError: 'NoneType' object is not subscriptable."
@preetinderverma9694
@preetinderverma9694 4 года назад
did you find the resolution ? i am getting same error
@ngocthangphan8968
@ngocthangphan8968 Год назад
so if you don't enter the header is it ok?
@Xantium0
@Xantium0 4 года назад
Great video. Very helpful for getting started. However what do I do if I get redirected from my login page. For example say I log in at www.example.com, and press sign in, and I get redirected to www.example.com/account How do I scrape the page from there
@oussamamoussaoui5821
@oussamamoussaoui5821 3 года назад
Thank you so much bro
@UnitySimplified
@UnitySimplified 2 года назад
Thanks you so much sir
@jackroark6928
@jackroark6928 4 года назад
Love it!
Далее
Requests Library in Python - Beginner Crash Course
20:32
This Is Why Python Data Classes Are Awesome
22:19
Просмотров 797 тыс.
If __name__ == "__main__" for Python Developers
8:47
Просмотров 390 тыс.
Request Headers for Web Scraping
10:03
Просмотров 45 тыс.
Modern Python logging
21:32
Просмотров 166 тыс.