Open bobbyleu opened 1 month ago
能提供下开发环境,或提供下具体报错截图?
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested exec /usr/local/bin/python: exec format error 使用以下代码忽略架构后可以执行,但是还是报错
docker run --privileged --rm tonistiigi/binfmt --install all
将默认 Docker 构建器切换为多架构构建器
docker buildx create --use
查看新的多架构构建器是否生效,需执行
docker buildx ls
之后就可以按正常步骤部署了。```
```2024-10-21 10:01:31.229 | INFO | __main__:get_jd_pt_key:384 - 未配置代理
Traceback (most recent call last):
File "/app/main.py", line 391, in get_jd_pt_key
page = await context.new_page()
File "/usr/local/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 12530, in new_page
return mapping.from_impl(await self._impl_obj.new_page())
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_browser_context.py", line 296, in new_page
return from_channel(await self._channel.send("newPage"))
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 59, in send
return await self._connection.wrap_api_call(
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 514, in wrap_api_call
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.TargetClosedError: BrowserContext.new_page: Target page, context or browser has been closed
Traceback (most recent call last):
File "/app/main.py", line 562, in main
pt_key = await get_jd_pt_key(playwright, user)
File "/app/main.py", line 478, in get_jd_pt_key
await context.close()
File "/usr/local/lib/python3.10/site-packages/playwright/async_api/_generated.py", line 13138, in close
return mapping.from_maybe_impl(await self._impl_obj.close(reason=reason))
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_browser_context.py", line 552, in close
await self._channel.send("close", {"reason": reason})
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 59, in send
return await self._connection.wrap_api_call(
File "/usr/local/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 514, in wrap_api_call
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.TargetClosedError: BrowserContext.close: Target page, context or browser has been closed```
能提供下开发环境,或提供下具体报错截图?
就是arm架构的,您现在提供的是amd的
报错是系统根本打开不了网页。Playwright官方不支持arm。arm如要使用Playwright,需手动改变定制浏览器存放目录的环境变量。看是否按https://saltedfish.fun/index.php/archives/26/ 这个文档,使用本地部署来实现
使用docker时提示不支持系统。