Home > front end >  Need help to see redirect python
Need help to see redirect python

Time:02-13

I have a problem with a website called www.webhallen.com. I want to put any numbers and character after www.webhallen.com/ for example www.webhallen.com/3459gdfg. I then want to se if that website exist the problem is that the site rederect me to there own 404 site. How can via requests see if they rederect me?

CodePudding user response:

You can check for the response status code. If you get response.status_code as 404. You will have been redirected to there 404 site.

CodePudding user response:

what framework do you use if you use Django you can use Exception handling https://www.django-rest-framework.org/api-guide/exceptions/

  • Related