安装时问题
- CMD执行 playwright install时出现
Downloading Chromium 115.0.5790.24 (playwright build v1067) from https://playwright.azureedge.net/builds/chromium/1067/chromium-win64.zip
Error: unable to verify the first certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1540:34)
at TLSSocket.emit (node:events:513:28)
at TLSSocket._finishInit (node:_tls_wrap:959:8)
at ssl.onhandshakedone (node:_tls_wrap:743:12) {
code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
}
解决:
在命令行先输入 set NODE_TLS_REJECT_UNAUTHORIZED=0
,再执行 playwright install
- 在执行 pytest时出现
E playwright._impl._api_types.Error: Host system is missing dependencies!
E
E Full list of missing libraries:
E chrome_elf.dll
解决:
将 C:\Users\XXX\AppData\Local\ms-playwright\chromium-1067\chrome-win
目录下的 chrome_elf.dll
复制到C:\Windows\System32
下即可。