This is a yaml demo to show how to use Midscene.js with GLM-V to do some automation tasks.
create .env file
# Replace with your own API key
MIDSCENE_MODEL_BASE_URL="https://open.bigmodel.cn/api/paas/v4" # or https://api.z.ai/api/paas/v4
MIDSCENE_MODEL_API_KEY="......"
MIDSCENE_MODEL_NAME="glm-4.6v"
MIDSCENE_MODEL_FAMILY="glm-v"Refer to this document if your want to use other models: https://midscenejs.com/model-strategy.html
Ensure that Node.js is installed.
npm i @midscene/cliFor windows, you need to replace
./with.\, likemidscene .\midscene-scripts\.
Perform a search on ebay.com
npx midscene ./midscene-scripts/search-headphone-on-ebay.yamlRun a script with headed mode (i.e. you can see the browser window when running)
npx midscene --headed ./midscene-scripts/search-headphone-on-ebay.yamlKeep the browser window open after the script finishes
npx midscene --keep-window ./midscene-scripts/search-headphone-on-ebay.yaml