ZRHan
ZRHan
请问一下 ``` ╔════════════════════════════════════════════════════════════════════════════════════════════════╗ ║ Looks like you launched a headed browser without having a XServer running. ║ ║ Set either 'headless: true' or use 'xvfb-run ' before running Playwright. ║...
> 请问一下 > > ``` > ╔════════════════════════════════════════════════════════════════════════════════════════════════╗ > ║ Looks like you launched a headed browser without having a XServer running. ║ > ║ Set either 'headless: true' or use...
This is odd. Perhaps it has something to do with the headers?
And when I modified it to ```python @login_required def is_session_alive(self) -> bool: steam_login = self.username headers = { 'Cache-Control': 'max-age=0', 'Sec-Ch-Ua': '"Not?A_Brand";v="8", "Chromium";v="108"', 'Sec-Ch-Ua-Mobile': '?0', 'Sec-Ch-Ua-Platform': "Windows", 'Upgrade-Insecure-Requests': '1', 'User-Agent':...
Through the process of elimination, I found that adding `Accept` to the headers can fix this issue. Namely: ```python headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', } ```