question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] `response.status_text` is empty on Chromium

See original GitHub issue

Context:

  • Playwright Version: 1.24.0
  • Operating System: Linux
  • Python version: 3.10.5
  • Browser: Chromium

Code Snippet

from playwright.sync_api import sync_playwright, Page, Browser, BrowserContext, Response


def main():
    """Main"""
    with sync_playwright() as spw:
        brw: Browser = spw.chromium.launch()
        # print('Browser was launched!')
        cxt_main: BrowserContext = brw.new_context(ignore_https_errors=True)
        # print('Context was created!')
        page: Page = cxt_main.new_page()
        # print('Opened a new page!')
        resp: Response = page.goto('https://stackoverflow.com/404')
        print(resp.status_text) # empty str
        cxt_main.close()
        # print('Context was closed!')
        brw.close()
        # print('Browser was closed!')


main()

Describe the bug

On Chromium response.status_text is always empty.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
rwollcommented, Jul 29, 2022

If you go to https://stackoverflow.com/404 in stock FF, CR, and WK, and then run: fetch("https://stackoverflow.com/404").then(r => console.log(r.statusText)) you’ll see Firefox is the only one to have statusText set to “Not Found” in this case (site doesn’t set it explicitly), so I believe Playwright’s behavior here is appropriate.

/cc @pavelfeldman

1reaction
pavelfeldmancommented, Jul 31, 2022

Closing as per above, please feel free to open a new issue if this does not cover your use case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is the statusText of my XHR empty? - Stack Overflow
According to the documentation for XMLHttpRequest. statusText , it should only be empty while the request is being processed. However, I am seeing...
Read more >
562599 - XMLHttpRequest statusText does not contain the ...
1. Do an XMLHttpRequest POST request to an URI returning error code 400, statutText of "test" 2. Print the statusText received when the...
Read more >
Response.statusText - Web APIs | MDN
The statusText read-only property of the Response interface ... A String containing the HTTP status message associated with the response.
Read more >
XMLHttpRequest fails for responses with HTTP status 407
The XMLHttpRequest object is empty: xhr.responseText is "" xhr.status is 0 xhr.statusText is "" In a test sweep over responses with 57 different...
Read more >
Empty AJAX response when URL works fine in browser
However, anytime I try to GET something I just get an empty response back. Body is null and statusText is empty.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found