1

Can someone confirm that http redirects are not enabled by default for urllib.request.urlopen()

I'm trying to trigger urllib.request.urlopen(req). The response seen using my web browser Firefox (not python) is HTTP 302 which indicates a redirect and then Firefox automatically goes to the redirected page which returns HTTP 301 (permanently moved) followed by HTTP 200 (OK).

I'm simulating what the browser is doing in python but the resulting web page is not as expected and I believe it's because the redirect is not being handled.

Paul Rooney
  • 20,879
  • 9
  • 40
  • 61
user1144251
  • 327
  • 1
  • 3
  • 12

0 Answers0