Python Forum
How to resolve a 401 error, when the credentials work fine in a browser
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to resolve a 401 error, when the credentials work fine in a browser
#5
Hi Larz,

I know what's going on now, and (in principle, at least) how to adjust the second authentication attempt appropriately. The header from the first request tells us what type of Authentication to use, in the retry.

So really all I need is to understand the nature of that header data - it looks like a simple dictionary - and proceed according to the type of Authentication returned.

If you have any other tips or links for this, supply them if you can. But I'm on the right track now, and will probably figure this out shortly.

Thanks much,




(Apr-21-2020, 07:43 PM)Larz60+ Wrote: I actually never use it.
Usually the only sites that I scrape are open enough that's it's not needed.
I have run across enough instances where others use it that it was in the back of my mind, therefore the post.
requests documentation here: https://requests.readthedocs.io/en/maste...entication
shows that it should be used as I posted.
I only capture the return (in my variable response) because I usually use status_code, but also other parts of the returned structure.
Reply


Messages In This Thread
RE: How to resolve a 401 error, when the credentials work fine in a browser - by PyCurious - Apr-21-2020, 08:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Web scrapping login facebook credentials kosmas9 0 1,987 Aug-17-2020, 01:33 PM
Last Post: kosmas9
  webdriver.remote to connect back existing browser without open new browser? gahhon 6 6,873 Feb-26-2019, 03:53 PM
Last Post: gahhon
  Can't Resolve Webscraping AttributeError Hass 1 2,353 Jan-15-2019, 09:36 PM
Last Post: nilamo
  Flask: Error output to the browser instead of error_log nikos 1 2,811 Sep-28-2018, 12:49 PM
Last Post: thomasp
  Enable error logging to browser for Python's Flask under Apache + mod_wsgi nikos 1 3,112 Sep-18-2018, 09:15 PM
Last Post: nikos
  Best practice for sharing gspread credentials to server shlomiLan 1 2,979 Jul-31-2018, 07:40 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020