В последней версии Playwright (1.42), когда в браузере установлен мобильный режим, и я имитирую функцию подписи на элементе холста, нажимая левую кнопку мыши и перемещая мышь, на холсте не создаются штрихи. .
Код следующий:
from playwright.sync_api import sync_playwright
with sync_playwright() as playwright:
iphone = playwright.devices["iPhone 12 Pro"]
browser = playwright.chromium.launch(headless=False)
context = browser.new_context(**iphone)
context.grant_permissions(['camera', 'microphone'])
page = context.new_page()
page.goto(
"https://yc-h5-test15.hrfax.cn/ccip/sign ... 4ifQ%3D%3D")
page.locator("//uni-view[@Class='btns-box']").click()
page.wait_for_timeout(3000)
page.locator("//uni-button").click()
canvas = page.locator("#canvas")
canvas_box = canvas.bounding_box()
center_x = canvas_box['x'] + canvas_box['width'] / 2
center_y = canvas_box['y'] + canvas_box['height'] / 2
page.mouse.move(center_x, center_y)
page.mouse.down(button="left")
page.mouse.move(center_x, center_y + 100)
page.mouse.up()
page.wait_for_timeout(100000)
After running the code, there is no stroke appearing on the canvas board in the web page.
The expectation is that when the web page is set to mobile mode, it should be possible to simulate signature actions by smoothly moving the mouse on the canvas board and have the strokes displayed correctly.
Подробнее здесь: https://stackoverflow.com/questions/781 ... es-are-not
При применении операций page.mouse() в элементе холста штрихи не генерируются. ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение