title: How to set Playwright not automatically follow the redirect?
body: <p>I want to open a website using Playwright,
  but I don't want to be automatically redirected.</p>
  <p>In some other web clients, they have parameter link <code>follow=False</code> to disable automatically following the redirection. But I can't find it on Playwright.</p>
  <pre class="lang-py prettyprint-override"><code>async def run(playwright):
      chromium = playwright.chromium
      browser = await chromium.launch()
      context = await browser.new_context()
      page = await context.new_page()
  
      def handle_response(response):
          print(f'status: {response.status} {response.url}')
      page.on('response', handle_response)
  
      await page.goto(&quot;https://google.com&quot;)
      await browser.close()
  
  </code></pre>
  <p>that's the sample code, as we know google.com would respond 301 and will be redirected to <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a>.
  Is it possible to stop the process after I got the 301, so I don't need to continue processing <a href="http://www.google.com" rel="nofollow noreferrer">www.google.com</a> and all the responses after that?</p>
  <p>From the <a href="https://playwright.dev/python/docs/api/class-request" rel="nofollow noreferrer">Request documentation</a>, I got that <code>Page.on('response')</code> emitted when/if the response status and headers are received for the request.</p>
  <p>But how to stop the Request after the Page got on('response') callback?
  I saw some other questions similar, using Route.abort() or Route.fulfill(), but I still don't get the answer for my case.</p>
  <p>thank you for your help.</p>