### Install dependencies with pip Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Installs the required Python dependencies listed in requirements.txt. Run this command in the project root before using the demo. ```bash pip install -r requirements.txt ``` -------------------------------- ### Run ziniao_webdriver_demo.py Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Runs the main demo script. Execute this command after configuring config.yaml. ```python python ziniao_webdriver_demo.py ``` -------------------------------- ### Configure Ziniao browser settings in config.yaml Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Configures the Ziniao browser settings in config.yaml. Set version to v5 or v6, client_path to the browser executable, and webdriver_path to the folder containing chromedriver. On Linux, webdriver_path is optional because the kernel driver is used. ```yaml ziniao: browser: # 浏览器版本 v5或v6 version: v6 # 浏览器客户端路径,windows V5程序名为starter.exe,V6程序名为ziniao.exe。mac为客户端程序名称ziniao。linux为客户端程序路径/opt/ziniao/ziniaobrowser client_path: D:\ziniao\ziniao.exe # 浏览器驱动路径,存放chromedriver的文件夹路径。linux使用内核自带的driver程序,不再额外下载,可不设置 webdriver_path: D:\webdriver ``` -------------------------------- ### Configure Ziniao user login info in config.yaml Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Sets the enterprise login credentials for the Ziniao browser in config.yaml. Replace the placeholder values with your actual company name, username, and password. ```yaml ziniao: # 企业登录的用户信息 user_info: company: 您登录紫鸟浏览器的时候输入的企业公司名 username: 您登录紫鸟浏览器的时候输入的企业用户名 password: 您登录紫鸟浏览器的时候输入的密码 ``` -------------------------------- ### Add task to config.yaml task list Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Adds the new task to the task list in config.yaml. The task name must match the key in func_dict. ```yaml task: # 任务列表 amazon: - feedback_export # 反馈导出 ``` -------------------------------- ### Filter stores by siteId in Python Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Filters the browser list to only run scripts for stores with a specific siteId. Replace '1' with the desired site ID, e.g., 1 for US Amazon. ```python # 过滤指定店铺运行脚本(例如美国亚马逊:siteId=1) amazon_store = [browser for browser in browser_list if browser.get('siteId') == '1'] ``` -------------------------------- ### Custom automation in use_one_browser_run_task Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Custom automation code to insert in the use_one_browser_run_task function. Place your custom operations between the two print statements. ```python # 打开店铺平台主页后进行后续自动化操作 print(f"=====进行脚本执行:{store_name}=====") # todo 自定义自动化操作 print(f"=====脚本全部执行完毕:{store_name}=====") ``` -------------------------------- ### Configure task list in config.yaml Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Configures the task list in config.yaml. Set thread_num for concurrency and uncomment or add task names under amazon. The commented line shows how to disable a task. ```yaml task: thread_num: 3 # 任务列表 amazon: # - feedback_export # 反馈导出 - customer_voice_export # 客户评价导出 - business_report_export # 销售和流量业务报表导出 - orders_export # 订单导出 ``` -------------------------------- ### Register task function in func_dict Source: https://github.com/ziniao-open/ziniao_webdriver_demo/blob/main/README.md Adds a new task function to the func_dict in ziniao_webdriver_demo.py. The key is the task name used in config.yaml, and the value is the function that implements the task. ```python func_dict = { "feedback_export": amazon_feedback_export } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.