Python Requests - Basic Access Authentication

Viewed 219

enter image description here

New to Python and web scraping here. I'm trying to understand the Basic Access Authentication parameter in the requests library. For example, if I am trying to use the post method as follows:

requests.post("www.somewebsite.com", data = some_data, auth = ('user', 'pass'))

What exactly is the 'user' and 'pass' parameter? Do I need to create an account for that respective website and pass in my account's username and password? I tried running my query without the 'auth' parameter and I return a 403 status code, so it is my understanding that I need to include the 'auth' parameter.

Any advice regarding this will help, thank you.

1 Answers

Any Api have it's own authentication process. You mentioned Github, which requires a username and password to authenticate. Some Api's may require some kind of access-token or stuff like that.

You can gain more information from Here.

Related