Skip to content

Browser Automation

Full web automation: navigation, interaction, data extraction, screenshots, and performance monitoring.

38 modules

ModuleDescription
Nhấp phần tửNhấp vào một phần tử trên trang
Đóng trình duyệtĐóng phiên trình duyệt và giải phóng tài nguyên
Chụp ConsoleChụp nhật ký console trình duyệt (lỗi, cảnh báo, thông tin)
Quản lý CookiesLấy, đặt hoặc xóa cookie trình duyệt
Xử lý hộp thoạiXử lý hộp thoại alert, confirm và prompt
Tải tệpTải tệp từ trình duyệt
Kéo và thảKéo và thả các phần tử
Mô phỏng thiết bịMô phỏng thiết bị hoặc đặt khung nhìn tùy chỉnh
Đảm bảo Trình duyệtĐảm bảo phiên trình duyệt tồn tại (tái sử dụng hoặc khởi chạy)
Thực thi JavaScriptThực thi mã JavaScript trong ngữ cảnh trang
Trích xuất dữ liệuTrích xuất dữ liệu có cấu trúc từ trang
Tìm phần tửTìm các phần tử trong trang và trả về danh sách ID phần tử
Điền Biểu mẫuĐiền biểu mẫu thông minh với phát hiện trường tự động
Chuyển FrameChuyển sang ngữ cảnh iframe hoặc frame
Giả lập vị trí địa lýGiả lập vị trí địa lý trình duyệt
Đi đến URLĐiều hướng đến một URL cụ thể
Di chuột qua phần tửDi chuột qua một phần tử
Khởi chạy trình duyệtKhởi chạy phiên trình duyệt mới với Playwright
Điều hướng lịch sửĐiều hướng lịch sử trình duyệt (quay lại, tiến tới, tải lại)
Giám sát mạngGiám sát và chặn các yêu cầu mạng
Danh sách TrangLiệt kê tất cả các trang/tab trình duyệt đang mở
Phân trang & Trích xuấtTự động phân trang và trích xuất dữ liệu
Tạo PDFTạo PDF từ trang hiện tại
Chỉ số Hiệu suấtThu thập các chỉ số hiệu suất trình duyệt
Nhấn phímNhấn một phím bàn phím
Ghi hành độngGhi lại các hành động người dùng dưới dạng workflow
Giải phóng Trình duyệtGiải phóng phiên trình duyệt (chỉ đóng nếu sở hữu)
Chụp màn hìnhChụp ảnh màn hình của trang hiện tại
Cuộn trangCuộn trang đến phần tử, vị trí hoặc hướng
Chọn tùy chọnChọn tùy chọn từ phần tử dropdown
Ảnh chụp DOMChụp ảnh DOM của trang hiện tại
Lưu trữ trình duyệtTruy cập localStorage và sessionStorage
Quản lý TabTạo, chuyển và đóng các tab trình duyệt
Dấu vết Trình duyệtBắt đầu, dừng hoặc lưu dấu vết hiệu suất trình duyệt
Gõ văn bảnGõ văn bản vào trường input
Tải tệp lênTải tệp lên phần tử input file
Đặt khung nhìnLấy hoặc đặt kích thước khung nhìn trình duyệt
ChờChờ một khoảng thời gian hoặc cho đến khi một phần tử xuất hiện

Modules

Nhấp phần tử

browser.click

Nhấp vào một phần tử trên trang

Parameters:

NameTypeRequiredDefaultDescription
click_methodselect (text, button, id, selector)NotextChoose the easiest way to identify the element you want to click
targetstringNo-e.g. "Submit", "Next Page", "Login"
selectorstringNo-CSS selector, XPath, or text selector
buttonselect (left, right, middle)NoleftWhich mouse button to use for clicking
click_countnumberNo1Number of clicks (2 for double-click, 3 for triple-click)
forcebooleanNoFalseForce click even if element is not actionable (covered, invisible)
modifiersarrayNo-Modifier keys to hold during click
timeoutnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
browserobjectBrowser session (pass-through for chaining)
statusstringTrạng thái thao tác (success/error)
selectorstringTrạng thái thao tác (success/error)
methodstringClick method used

Example: Example

yaml
click_method: text
target: Submit

Example: Example

yaml
click_method: id
target: login-button

Example: Example

yaml
click_method: selector
selector: #submit-button

Đóng trình duyệt

browser.close

Đóng phiên trình duyệt và giải phóng tài nguyên

Parameters:

NameTypeRequiredDefaultDescription
_no_paramsbooleanNoTrueThis module requires no parameters

Output:

FieldTypeDescription
statusstringĐóng phiên trình duyệt
messagestringĐóng phiên trình duyệt

Example: Example

yaml

Chụp Console

browser.console

Chụp nhật ký console trình duyệt (lỗi, cảnh báo, thông tin)

Parameters:

NameTypeRequiredDefaultDescription
levelselect (all, error, warning, info, log)NoallFilter console messages by level
timeoutnumberNo5000Maximum time to wait in milliseconds
clear_existingbooleanNoFalseClear existing messages before capturing

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
messagesarrayTrạng thái thao tác (success/error)
countnumberTrạng thái thao tác (success/error)

Example: Example

yaml
timeout: 3000

Example: Example

yaml
level: error
timeout: 5000

Quản lý Cookies

browser.cookies

Lấy, đặt hoặc xóa cookie trình duyệt

Parameters:

NameTypeRequiredDefaultDescription
actionselect (get, set, clear, delete)Yes-Action to perform on the storage
namestringNo-Name of the cookie
valuestringNo-Value of the cookie
domainstringNo-Cookie domain
pathstringNo/Cookie path
securebooleanNoFalseWhether cookie is secure (HTTPS only)
httpOnlybooleanNoFalseWhether cookie is HTTP only
expiresnumberNo-Cookie expiration time (Unix timestamp)

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
cookiesarrayTrạng thái thao tác (success/error)
countnumberTrạng thái thao tác (success/error)

Example: Example

yaml
action: get

Example: Example

yaml
action: get
name: session_id

Example: Example

yaml
action: set
name: user_pref
value: dark_mode
domain: example.com

Example: Example

yaml
action: clear

Xử lý hộp thoại

browser.dialog

Xử lý hộp thoại alert, confirm và prompt

Parameters:

NameTypeRequiredDefaultDescription
actionselect (accept, dismiss, listen)Yes-How to respond to the dialog
prompt_textstringNo-Text to enter in prompt dialog (for accept action)
timeoutnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
messagestringTrạng thái thao tác (success/error)
typestringTrạng thái thao tác (success/error)
default_valuestringTin nhắn kết quả mô tả kết quả

Example: Example

yaml
action: accept

Example: Example

yaml
action: dismiss

Example: Example

yaml
action: accept
prompt_text: Hello World

Example: Example

yaml
action: listen
timeout: 5000

Tải tệp

browser.download

Tải tệp từ trình duyệt

Parameters:

NameTypeRequiredDefaultDescription
selectorstringNo-CSS selector, XPath, or text selector to find the element
save_pathstringYes-Path where to save the downloaded file
timeout_msnumberNo60000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
pathstringTrạng thái thao tác (success/error)
filenamestringTrạng thái thao tác (success/error)
sizenumberĐường dẫn tệp hoặc tài nguyên

Example: Example

yaml
selector: #download-btn
save_path: /downloads/report.pdf

Example: Example

yaml
selector: a.download
save_path: /downloads/large-file.zip
timeout_ms: 120000

Kéo và thả

browser.drag

Kéo và thả các phần tử

Parameters:

NameTypeRequiredDefaultDescription
sourcestringYes-CSS selector, XPath, or text selector to find the element
targetstringYes-CSS selector, XPath, or text selector to find the element
source_positionobjectNo-Position within source element {x, y} as percentages
target_positionobjectNo-Position within target element {x, y} as percentages
timeoutnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringVị trí trong phần tử đích {x, y} theo phần trăm
sourcestringVị trí trong phần tử đích {x, y} theo phần trăm
targetstringTrạng thái thao tác (success/error)

Example: Example

yaml
source: #item1
target: #dropzone

Example: Example

yaml
source: .draggable
target: .container
target_position: {"x": 0.5, "y": 0.5}

Mô phỏng thiết bị

browser.emulate

Mô phỏng thiết bị hoặc đặt khung nhìn tùy chỉnh

Parameters:

NameTypeRequiredDefaultDescription
deviceselect (iphone_12, iphone_14, iphone_14_pro_max, iphone_se, pixel_7, pixel_5, galaxy_s21, galaxy_s23, ipad_pro, ipad_mini, galaxy_tab_s8, desktop_chrome, desktop_firefox, desktop_safari, desktop_edge, laptop, macbook_pro, custom)Yes-Tên thiết bị để mô phỏng (ví dụ: iPhone 13)
widthnumberNo-Chiều rộng khung nhìn tính bằng pixel
heightnumberNo-Chiều cao khung nhìn tính bằng pixel
user_agentstringNo-Chuỗi user agent tùy chỉnh
is_mobilebooleanNo-Có mô phỏng thiết bị di động không
has_touchbooleanNo-Thiết bị có hỗ trợ cảm ứng không
device_scale_factornumberNo-Tỷ lệ điểm ảnh của thiết bị

Output:

FieldTypeDescription
statusstringTrạng thái hoạt động (thành công/lỗi)
devicestringTên thiết bị đã được mô phỏng
viewportobjectKích thước khung nhìn hiện tại
is_mobilebooleanMô phỏng di động có đang hoạt động không

Example: Example

yaml
device: iphone_14

Example: Example

yaml
device: ipad_pro

Example: Example

yaml
device: custom
width: 400
height: 800
is_mobile: true
has_touch: true
device_scale_factor: 2

Example: Example

yaml
device: desktop_chrome
user_agent: CustomBot/1.0

Đảm bảo Trình duyệt

browser.ensure

Đảm bảo phiên trình duyệt tồn tại (tái sử dụng hoặc khởi chạy)

Parameters:

NameTypeRequiredDefaultDescription
headlessbooleanNoFalseRun browser without visible window
widthnumberNo1280Browser viewport width in pixels
heightnumberNo720Browser viewport height in pixels

Output:

FieldTypeDescription
statusstringTrình duyệt đã được khởi chạy hay tái sử dụng
messagestringTrình duyệt đã được khởi chạy hay tái sử dụng
is_ownerbooleanTrình duyệt đã được khởi chạy hay tái sử dụng

Example: Example

yaml
headless: false

Example: Example

yaml
headless: true

Thực thi JavaScript

browser.evaluate

Thực thi mã JavaScript trong ngữ cảnh trang

Parameters:

NameTypeRequiredDefaultDescription
scriptstringYes-JavaScript code to execute (can use return statement)
argsarrayNo-Arguments to pass to the script function

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
resultanyTrạng thái thao tác (success/error)

Example: Example

yaml
script: return document.title

Example: Example

yaml
script: return document.querySelectorAll("a").length

Example: Example

yaml
script: (selector) => document.querySelector(selector)?.textContent
args: ["#header"]

Example: Example

yaml
script: document.body.style.backgroundColor = "red"; return "done"

Trích xuất dữ liệu

browser.extract

Trích xuất dữ liệu có cấu trúc từ trang

Parameters:

NameTypeRequiredDefaultDescription
selectorstringYes-CSS selector, XPath, or text selector to find the element
limitnumberNo-Maximum number of items to extract
fieldsobjectNo-Define fields to extract from each item

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
dataarrayTrạng thái thao tác (success/error)
countnumberTrạng thái thao tác (success/error)

Example: Example

yaml
selector: .g
limit: 10
fields: {"title": {"selector": "h3", "type": "text"}, "url": {"selector": "a", "type": "attribute", "attribute": "href"}}

Tìm phần tử

browser.find

Tìm các phần tử trong trang và trả về danh sách ID phần tử

Parameters:

NameTypeRequiredDefaultDescription
selectorstringYes-CSS selector, XPath, or text selector to find the element
limitnumberNo-Maximum number of items to extract

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
countnumberTrạng thái thao tác (success/error)
element_idsarrayTrạng thái thao tác (success/error)

Example: Find search results

yaml
selector: div.tF2Cxc
limit: 10

Điền Biểu mẫu

browser.form

Điền biểu mẫu thông minh với phát hiện trường tự động

Parameters:

NameTypeRequiredDefaultDescription
form_selectorstringNo-CSS selector for the form element (optional)
dataobjectYes-Key-value pairs to fill (key = field name/id, value = content)
field_mappingobjectNo-Custom selector mapping
clear_before_fillbooleanNoTrueClear existing field values before filling
submitbooleanNoFalseSubmit form after filling
submit_selectorstringNo-CSS selector for submit button
delay_between_fields_msnumberNo100Delay between filling each field (for more human-like behavior)

Output:

FieldTypeDescription
filled_fieldsarrayĐộ trễ giữa việc điền mỗi trường (để giống hành vi con người hơn)
failed_fieldsarrayDanh sách các trường đã được điền
submittedbooleanDanh sách các trường đã được điền

Example: Example

yaml
data: {"email": "user@example.com", "password": "secret123"}
submit: true

Example: Example

yaml
data: {"username": "john_doe", "bio": "Hello world"}
field_mapping: {"username": "#user-name-input", "bio": "textarea.bio-field"}

Chuyển Frame

browser.frame

Chuyển sang ngữ cảnh iframe hoặc frame

Parameters:

NameTypeRequiredDefaultDescription
selectorstringNo-CSS selector, XPath, or text selector to find the element
namestringNo-Name attribute of the frame (alternative to selector)
urlstringNo-URL pattern to match frame (alternative to selector)
actionstringNoenterFrame action to perform
timeoutnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringHành động frame (enter để chuyển sang frame, list để liệt kê tất cả frames)
frame_urlstringHành động frame (enter để chuyển sang frame, list để liệt kê tất cả frames)
frame_namestringTrạng thái thao tác (success/error)
framesarrayURL Frame

Example: Example

yaml
selector: iframe#content-frame

Example: Example

yaml
name: main-content

Example: Example

yaml
action: exit

Example: Example

yaml
action: list

Giả lập vị trí địa lý

browser.geolocation

Giả lập vị trí địa lý trình duyệt

Parameters:

NameTypeRequiredDefaultDescription
latitudenumberYes-Latitude coordinate (-90 to 90)
longitudenumberYes-Longitude coordinate (-180 to 180)
accuracynumberNo100Position accuracy in meters

Output:

FieldTypeDescription
statusstringĐộ chính xác vị trí tính bằng mét
locationobjectĐộ chính xác vị trí tính bằng mét

Example: Example

yaml
latitude: 37.7749
longitude: -122.4194

Example: Example

yaml
latitude: 51.5074
longitude: -0.1278
accuracy: 10

Example: Example

yaml
latitude: 35.6762
longitude: 139.6503

Đi đến URL

browser.goto

Điều hướng đến một URL cụ thể

Parameters:

NameTypeRequiredDefaultDescription
urlstringYes-URL to navigate to
wait_untilselect (load, domcontentloaded, networkidle)NodomcontentloadedWhen to consider navigation complete
timeout_msnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
urlstringĐiều hướng đến một URL cụ thể

Example: Example

yaml
url: https://www.google.com
wait_until: domcontentloaded

Di chuột qua phần tử

browser.hover

Di chuột qua một phần tử

Parameters:

NameTypeRequiredDefaultDescription
selectorstringYes-CSS selector, XPath, or text selector to find the element
timeout_msnumberNo30000Maximum time to wait in milliseconds
positionobjectNo-Click position relative to element (0-1 range)

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
selectorstringTrạng thái thao tác (success/error)

Example: Example

yaml
selector: .menu-item

Example: Example

yaml
selector: #dropdown-trigger
timeout_ms: 5000

Khởi chạy trình duyệt

browser.launch

Khởi chạy phiên trình duyệt mới với Playwright

Parameters:

NameTypeRequiredDefaultDescription
headlessbooleanNoFalseRun browser without visible window
widthnumberNo1280Browser viewport width in pixels
heightnumberNo720Browser viewport height in pixels
browser_typeselect (chromium, firefox, webkit)NochromiumCông cụ trình duyệt để sử dụng (chromium, firefox, webkit)
proxystringNo-URL máy chủ proxy
user_agentstringNo-Chuỗi user agent tùy chỉnh
localestringNoen-USBrowser locale (e.g. en-US, zh-TW, ja-JP)
slow_monumberNo0Làm chậm hoạt động theo mili giây chỉ định
record_video_dirstringNo-Directory to save recorded videos (enables Playwright video recording)

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
messagestringKhởi chạy phiên trình duyệt mới
browser_typestringLoại trình duyệt đã khởi chạy
headlessbooleanTrình duyệt có đang chạy chế độ không đầu không
viewportobjectKích thước khung nhìn hiện tại

Example: Example

yaml
headless: true

Example: Example

yaml
headless: false

Điều hướng lịch sử

browser.navigation

Điều hướng lịch sử trình duyệt (quay lại, tiến tới, tải lại)

Parameters:

NameTypeRequiredDefaultDescription
actionselect (back, forward, reload)YesreloadWhich navigation action to perform
wait_untilselect (load, domcontentloaded, networkidle)NodomcontentloadedWhen to consider navigation complete
timeout_msnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringTrạng thái hoạt động (thành công/lỗi)
actionstringHành động điều hướng đã thực hiện
urlstringURL hiện tại sau khi điều hướng

Example: Example

yaml
action: back

Example: Example

yaml
action: forward

Example: Example

yaml
action: reload
wait_until: networkidle

Giám sát mạng

browser.network

Giám sát và chặn các yêu cầu mạng

Parameters:

NameTypeRequiredDefaultDescription
actionselect (monitor, block, intercept)Yes-Network action to perform
url_patternstringNo-Regex pattern to match request URLs
resource_typestringNo-Filter by resource type (document, script, image, etc)
timeoutnumberNo30000Maximum time to wait in milliseconds
mock_responseobjectNo-Response to return for intercepted requests

Output:

FieldTypeDescription
statusstringPhản hồi trả về cho các yêu cầu bị chặn
requestsarrayPhản hồi trả về cho các yêu cầu bị chặn
blocked_countnumberTrạng thái thao tác (success/error)

Example: Example

yaml
action: monitor
url_pattern: .*api.*
timeout: 10000

Example: Example

yaml
action: block
resource_type: image

Example: Example

yaml
action: intercept
url_pattern: .*users.*
mock_response: {"status": 200, "body": "{\"users\": []}"}

Danh sách Trang

browser.pages

Liệt kê tất cả các trang/tab trình duyệt đang mở

Parameters:

NameTypeRequiredDefaultDescription
include_detailsbooleanNoTrueBao gồm thông tin chi tiết cho mỗi trang
include_content_infobooleanNoFalseBao gồm thông tin loại nội dung cho mỗi trang

Output:

FieldTypeDescription
statusstringTrạng thái hoạt động (thành công/lỗi)
pagesarrayDanh sách các trang đang mở
countnumberSố lượng trang đang mở
current_indexnumberChỉ số của trang hiện tại đang hoạt động

Example: Example

yaml
include_details: true

Example: Example

yaml
include_details: false

Example: Example

yaml
include_details: true
include_content_info: true

Phân trang & Trích xuất

browser.pagination

Tự động phân trang và trích xuất dữ liệu

Parameters:

NameTypeRequiredDefaultDescription
modeselect (next_button, infinite_scroll, page_numbers, load_more)Nonext_buttonHow to navigate between pages
item_selectorstringYes-CSS selector for items to extract on each page
fieldsobjectNo-Field definitions {name: {selector, attribute?}}
next_selectorstringNo-CSS selector for next page button
load_more_selectorstringNo-CSS selector for load more button
max_pagesnumberNo10Maximum number of pages to process (0 = unlimited)
max_itemsnumberNo0Stop after collecting this many items (0 = unlimited)
wait_between_pages_msnumberNo1000Wait time between page navigations
wait_for_selectorstringNo-Wait for this element after page change
scroll_amountnumberNo1000Pixels to scroll for infinite scroll mode
no_more_indicatorstringNo-Selector that appears when no more pages (stops pagination)

Output:

FieldTypeDescription
itemsarrayChọn xuất hiện khi không còn trang nào nữa (dừng phân trang)
total_itemsintegerTất cả các mục đã trích xuất từ tất cả các trang
pages_processedintegerTất cả các mục đã trích xuất từ tất cả các trang
stopped_reasonstringSố trang đã xử lý

Example: Example

yaml
mode: next_button
item_selector: .product-card
fields: {"title": {"selector": ".title"}, "price": {"selector": ".price"}, "link": {"selector": "a", "attribute": "href"}}
next_selector: .pagination .next
max_pages: 5

Example: Example

yaml
mode: infinite_scroll
item_selector: .feed-item
fields: {"content": {"selector": ".content"}, "author": {"selector": ".author"}}
max_items: 100
no_more_indicator: .end-of-feed

Example: Example

yaml
mode: load_more
item_selector: .list-item
load_more_selector: button.load-more
max_pages: 10

Tạo PDF

browser.pdf

Tạo PDF từ trang hiện tại

Parameters:

NameTypeRequiredDefaultDescription
pathstringNo-Path where the output file will be saved
page_sizeselect (A4, Letter, Legal, A3, A5)NoA4Page size format
orientationselect (portrait, landscape)NoportraitPage orientation
print_backgroundbooleanNoTrueInclude background graphics
scalenumberNo1Scale of the webpage rendering (0.1-2)
marginnumberNo20Page margin in millimeters
headerstringNo-Header text for each page
footerstringNo-Footer text for each page

Output:

FieldTypeDescription
statusstringTỷ lệ hiển thị trang web (0.1-2)
pathstringTrạng thái thao tác (success/error)
sizenumberTrạng thái thao tác (success/error)

Example: Example

yaml
path: /output/page.pdf

Example: Example

yaml
path: /output/landscape.pdf
landscape: true

Example: Example

yaml
path: /output/custom.pdf
margin: {"top": "1cm", "bottom": "1cm", "left": "2cm", "right": "2cm"}

Chỉ số Hiệu suất

browser.performance

Thu thập các chỉ số hiệu suất trình duyệt

Parameters:

NameTypeRequiredDefaultDescription
metricsarrayNo['all']Chỉ số hiệu suất cần thu thập
timeout_msnumberNo3000Thời gian chờ tính bằng mili giây
setup_observersbooleanNoTrueThiết lập quan sát hiệu suất trước khi thu thập

Output:

FieldTypeDescription
statusstringTrạng thái hoạt động (thành công/lỗi)
metricsobjectCác chỉ số hiệu suất đã thu thập

Example: Example

yaml
metrics: ["all"]
timeout_ms: 5000

Example: Example

yaml
metrics: ["lcp", "fcp", "cls"]

Example: Example

yaml
metrics: ["ttfb", "domContentLoaded", "load"]
timeout_ms: 0

Nhấn phím

browser.press

Nhấn một phím bàn phím

Parameters:

NameTypeRequiredDefaultDescription
keystringYes-The key to press (e.g., Enter, Escape, Tab)

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
keystringNhấn một phím bàn phím

Example: Example

yaml
key: Enter

Example: Example

yaml
key: Escape

Ghi hành động

browser.record

Ghi lại các hành động người dùng dưới dạng workflow

Parameters:

NameTypeRequiredDefaultDescription
actionstringYes-Recording action to perform
output_formatstringNoyamlFormat for recorded workflow
output_pathstringNo-Path where the output file will be saved

Output:

FieldTypeDescription
statusstringĐịnh dạng cho workflow đã ghi (yaml hoặc json)
recordingarrayĐịnh dạng cho workflow đã ghi (yaml hoặc json)
workflowstringTrạng thái thao tác (success/error)

Example: Example

yaml
action: start

Example: Example

yaml
action: stop
output_format: yaml

Example: Example

yaml
action: get

Giải phóng Trình duyệt

browser.release

Giải phóng phiên trình duyệt (chỉ đóng nếu sở hữu)

Parameters:

NameTypeRequiredDefaultDescription
forcebooleanNoFalseĐóng trình duyệt ngay cả khi không thuộc mẫu này

Output:

FieldTypeDescription
statusstringĐóng trình duyệt ngay cả khi không thuộc mẫu này
messagestringHành động đã thực hiện
was_ownerbooleanHành động đã thực hiện

Example: Example

yaml

Example: Example

yaml
force: true

Chụp màn hình

browser.screenshot

Chụp ảnh màn hình của trang hiện tại

Parameters:

NameTypeRequiredDefaultDescription
pathstringNoscreenshot.pngPath where the output file will be saved
full_pagebooleanNoFalseCapture the entire scrollable page
formatselect (png, jpeg, webp)NopngImage format for the screenshot
qualitynumberNo-Quality for JPEG/WebP format (0-100)

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
filepathstringChụp ảnh màn hình của trang hiện tại

Example: Example

yaml
path: output/page.png

Cuộn trang

browser.scroll

Cuộn trang đến phần tử, vị trí hoặc hướng

Parameters:

NameTypeRequiredDefaultDescription
selectorstringNo-CSS selector, XPath, or text selector to find the element
directionselect (down, up, left, right)NodownDirection to scroll the page
amountnumberNo500Pixels to scroll (ignored if selector is provided)
behaviorselect (smooth, instant)NosmoothHow the scroll animation behaves

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
scrolled_toobjectTrạng thái thao tác (success/error)

Example: Example

yaml
selector: #footer

Example: Example

yaml
direction: down
amount: 500

Example: Example

yaml
direction: up
amount: 10000
behavior: smooth

Chọn tùy chọn

browser.select

Chọn tùy chọn từ phần tử dropdown

Parameters:

NameTypeRequiredDefaultDescription
selectorstringYes-CSS selector, XPath, or text selector to find the element
valuestringNo-Option value attribute to select
labelstringNo-Option text content to select (alternative to value)
indexnumberNo-Option index to select (0-based)
timeoutnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
selectedarrayTrạng thái thao tác (success/error)
selectorstringTrạng thái thao tác (success/error)

Example: Example

yaml
selector: select#country
value: us

Example: Example

yaml
selector: select#country
label: United States

Example: Example

yaml
selector: select#country
index: 2

Ảnh chụp DOM

browser.snapshot

Chụp ảnh DOM của trang hiện tại

Parameters:

NameTypeRequiredDefaultDescription
formatselect (html, mhtml, text)NohtmlĐịnh dạng đầu ra (html hoặc văn bản)
selectorstringNo-Bộ chọn CSS để chụp một phần tử cụ thể
pathstringNo-Đường dẫn để lưu ảnh chụp

Output:

FieldTypeDescription
statusstringTrạng thái hoạt động (thành công/lỗi)
formatstringĐịnh dạng của ảnh chụp
contentstringNội dung ảnh chụp
pathstringĐường dẫn nơi lưu ảnh chụp
size_bytesnumberKích thước của ảnh chụp tính bằng byte

Example: Example

yaml
format: html

Example: Example

yaml
format: mhtml
path: /tmp/page.mhtml

Example: Example

yaml
format: text
selector: article.main-content

Example: Example

yaml
format: html
selector: #main
path: /tmp/section.html

Lưu trữ trình duyệt

browser.storage

Truy cập localStorage và sessionStorage

Parameters:

NameTypeRequiredDefaultDescription
actionselect (get, set, remove, clear, keys, length)Yes-Action to perform on the storage
typeselect (local, session)NolocalBrowser storage type to access
keystringNo-Storage key
valuestringNo-Value to store

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
valueanyTrạng thái thao tác (success/error)
keysarrayTrạng thái thao tác (success/error)
lengthnumberGiá trị trả về

Example: Example

yaml
action: get
type: local
key: user_token

Example: Example

yaml
action: set
type: session
key: temp_data
value: {"id": 123}

Example: Example

yaml
action: clear
type: local

Example: Example

yaml
action: keys
type: local

Quản lý Tab

browser.tab

Tạo, chuyển và đóng các tab trình duyệt

Parameters:

NameTypeRequiredDefaultDescription
actionstringYes-Tab action to perform
urlstringNo-URL to navigate to
indexnumberNo-Tab index to switch to or close (0-based)

Output:

FieldTypeDescription
statusstringChỉ số tab để chuyển đến hoặc đóng (bắt đầu từ 0)
tab_countnumberChỉ số tab để chuyển đến hoặc đóng (bắt đầu từ 0)
current_indexnumberTrạng thái thao tác (success/error)
tabsarraySố lượng tab

Example: Example

yaml
action: new
url: https://example.com

Example: Example

yaml
action: switch
index: 0

Example: Example

yaml
action: close

Example: Example

yaml
action: list

Dấu vết Trình duyệt

browser.trace

Bắt đầu, dừng hoặc lưu dấu vết hiệu suất trình duyệt

Parameters:

NameTypeRequiredDefaultDescription
actionstringYes-Hành động dấu vết (bắt đầu, dừng, lưu)
categoriesarrayNo['devtools.timeline']Danh mục dấu vết cần chụp
screenshotsbooleanNoTrueBao gồm ảnh chụp màn hình trong dấu vết
pathstringNo-Đường dẫn để lưu tệp dấu vết

Output:

FieldTypeDescription
statusstringTrạng thái hoạt động (thành công/lỗi)
tracingbooleanDấu vết hiện có đang hoạt động hay không
pathstringĐường dẫn nơi lưu dấu vết
size_bytesnumberKích thước của tệp dấu vết tính bằng byte

Example: Example

yaml
action: start
screenshots: true

Example: Example

yaml
action: start
categories: ["devtools.timeline", "v8.execute"]
screenshots: false

Example: Example

yaml
action: stop
path: /tmp/performance-trace.json

Gõ văn bản

browser.type

Gõ văn bản vào trường input

Parameters:

NameTypeRequiredDefaultDescription
type_methodselect (placeholder, label, name, id, selector)NoplaceholderChoose the easiest way to identify the input field
targetstringNo-e.g. "Enter your email", "Email", "username"
selectorstringNo-CSS selector, XPath, or text selector
input_typeselect (text, password, email)NotextType of input field — use Password to mask the value in the builder
textstringYes-
sensitive_textstringYes-
delaynumberNo0Delay between keystrokes in milliseconds
clearbooleanNoFalseClear the input field before typing
timeoutnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
browserobjectBrowser session (pass-through for chaining)
statusstringTrạng thái thao tác (success/error)
selectorstringGõ văn bản vào trường input
methodstringType method used

Example: Example

yaml
type_method: placeholder
target: Enter your email
text: user@example.com

Example: Example

yaml
type_method: label
target: Email
text: user@example.com

Example: Example

yaml
type_method: placeholder
target: Password
input_type: password
sensitive_text: ${env.LOGIN_PASSWORD}

Example: Example

yaml
type_method: selector
selector: #email
text: user@example.com

Tải tệp lên

browser.upload

Tải tệp lên phần tử input file

Parameters:

NameTypeRequiredDefaultDescription
selectorstringYes-CSS selector, XPath, or text selector to find the element
file_pathstringYes-Local path to the file to upload
timeout_msnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
filenamestringTrạng thái thao tác (success/error)
sizenumberTrạng thái thao tác (success/error)
selectorstringTên tệp

Example: Example

yaml
selector: input[type="file"]
file_path: /path/to/image.png

Example: Example

yaml
selector: #file-upload
file_path: /path/to/document.pdf

Đặt khung nhìn

browser.viewport

Lấy hoặc đặt kích thước khung nhìn trình duyệt

Parameters:

NameTypeRequiredDefaultDescription
widthnumberYes1280Chiều rộng khung nhìn tính bằng pixel
heightnumberYes720Chiều cao khung nhìn tính bằng pixel

Output:

FieldTypeDescription
statusstringTrạng thái hoạt động (thành công/lỗi)
viewportobjectKích thước khung nhìn hiện tại
previous_viewportobjectKích thước khung nhìn trước đó

Example: Example

yaml
width: 375
height: 667

Example: Example

yaml
width: 768
height: 1024

Example: Example

yaml
width: 1920
height: 1080

Example: Example

yaml
width: 1366
height: 768

Chờ

browser.wait

Chờ một khoảng thời gian hoặc cho đến khi một phần tử xuất hiện

Parameters:

NameTypeRequiredDefaultDescription
duration_msnumberNo1000Duration of the operation in milliseconds
selectorstringNo-CSS selector, XPath, or text selector to find the element
stateselect (visible, hidden, attached, detached)NovisibleTrạng thái cần chờ (hiển thị, ẩn, đính kèm, tách rời)
timeout_msnumberNo30000Maximum time to wait in milliseconds

Output:

FieldTypeDescription
statusstringTrạng thái thao tác (success/error)
selectorstringTrạng thái thao tác (success/error)
duration_msnumberChờ một khoảng thời gian hoặc phần tử xuất hiện

Example: Example

yaml
duration_ms: 2000

Example: Example

yaml
selector: #loading-complete
timeout_ms: 5000

Released under the Apache 2.0 License.