rpa m
This commit is contained in:
parent
beb4b396b8
commit
5f921bbf81
|
|
@ -271,15 +271,15 @@ async def do_finalized_product(current_product_id: str,
|
||||||
f"****** Finalized product session - Start: {start_time}, End: {last_live_time}, Duration: {duration}ms, Product: {current_product_name}")
|
f"****** Finalized product session - Start: {start_time}, End: {last_live_time}, Duration: {duration}ms, Product: {current_product_name}")
|
||||||
|
|
||||||
|
|
||||||
async def init_load(page):
|
async def init_load(page:Page):
|
||||||
await page.wait_for_selector("[data-e2e='live-promotion-list']", timeout=60000)
|
# await page.wait_for_selector("[data-e2e='live-promotion-list']", timeout=60000)
|
||||||
await page.wait_for_function(
|
# await page.wait_for_function(
|
||||||
"""() => {
|
# """() => {
|
||||||
const element = document.querySelector('[data-e2e="live-promotion-list"]');
|
# const element = document.querySelector('[data-e2e="live-promotion-list"]');
|
||||||
return element && element.innerText !== "加载中";
|
# return element && element.innerText !== "加载中";
|
||||||
}""",
|
# }""",
|
||||||
timeout=60000
|
# timeout=60000
|
||||||
)
|
# )
|
||||||
promotion_list_js = """(function() {
|
promotion_list_js = """(function() {
|
||||||
const selectors = ['[data-e2e="live-promotion-list"]', '.promotion-list'];
|
const selectors = ['[data-e2e="live-promotion-list"]', '.promotion-list'];
|
||||||
for (const sel of selectors) {
|
for (const sel of selectors) {
|
||||||
|
|
@ -350,25 +350,25 @@ async def do_explaining(current_product_id, current_product_img, current_product
|
||||||
|
|
||||||
async def refresh_page(page: Page):
|
async def refresh_page(page: Page):
|
||||||
try:
|
try:
|
||||||
# await page.reload(timeout=60000)
|
await page.reload(timeout=60000)
|
||||||
# await page.wait_for_load_state("networkidle", timeout=60000)
|
await page.wait_for_load_state("networkidle", timeout=60000)
|
||||||
# await page.wait_for_selector("[data-e2e='live-promotion-list']", timeout=60000)
|
await page.wait_for_selector("[data-e2e='live-promotion-list']", timeout=60000)
|
||||||
# await page.wait_for_function(
|
await page.wait_for_function(
|
||||||
# """() => {
|
"""() => {
|
||||||
# const element = document.querySelector('[data-e2e="live-promotion-list"]');
|
const element = document.querySelector('[data-e2e="live-promotion-list"]');
|
||||||
# return element && element.innerText !== "加载中";
|
return element && element.innerText !== "加载中";
|
||||||
# }""",
|
}""",
|
||||||
# timeout=60000
|
timeout=60000
|
||||||
# )
|
)
|
||||||
|
|
||||||
svg = page.locator('#__living_right_panel_id svg').first
|
# svg = page.locator('#__living_right_panel_id svg').first
|
||||||
await svg.click()
|
# await svg.click()
|
||||||
print("已点击关闭标签的 SVG 图标")
|
# print("已点击关闭标签的 SVG 图标")
|
||||||
await page.wait_for_timeout(3 * 1000)
|
# await page.wait_for_timeout(3 * 1000)
|
||||||
|
#
|
||||||
await page.get_by_text("全部商品").click()
|
# await page.get_by_text("全部商品").click()
|
||||||
print("已点击 全部商品 ")
|
# print("已点击 全部商品 ")
|
||||||
await page.wait_for_timeout(3 * 1000)
|
# await page.wait_for_timeout(3 * 1000)
|
||||||
|
|
||||||
# page.get_by_text("继续播放").click()
|
# page.get_by_text("继续播放").click()
|
||||||
# page.wait_for_timeout(3 * 000)
|
# page.wait_for_timeout(3 * 000)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue