def main_market_playwright():
context, my_playwright, page = launch_chromium_with_extension_sync(debug=True)
js = """
Object.defineProperties(navigator, {webdriver:{get:()=>undefined}});
"""
page.add_init_script(js)
# 所有页面操作的列表
page_functions = [
# oppo 有版本检查 所以放在最上面
oppo_page,
xiaomi_page,
anguo_page,
sanliuling_page,
vivo_page,
wandoujia_page,
yyb_page,
baidu_page,
huawei_by_context,
meizu_page,
honnor_by_context,
yyh_page,
samsung_page,
google_page
]
# 对每个页面函数进行遍历和执行
for page_function in page_functions:
# 创建新页面,或者复用page,这里以创建新页面为例
page_function(page, context) # 调用页面函数,传递新页面对象
# ---------------------
context.close()
my_playwright.stop()