'How to automatically change bearer token in python code

I am scraping a site in an hourly basis through post requests but everyday the authorisation bearer token changes and I have to copy paste new token from the site to my headers dict. How can I automate this so that I don’t have to copy paste this new token everyday. Is there any way so that I can get the token through site link and save it as a variable so that I can pass through the header dict. Any type of help is appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source