### Get Resource Bytes Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Retrieves the binary information of a resource file. Use this for non-textual file content. ```python from . import package def main(args): value = package.resources.get_bytes('123.txt') # 输出结果将以二进制的形式返回 print(value) ``` -------------------------------- ### Get Resource Text Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Retrieves the text content of a resource file. Specify the filename and optionally the encoding (defaults to utf-8). ```python from . import package def main(args): text = package.resources.get_text('123.txt') print(text) ``` -------------------------------- ### Attribute Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for setting, getting, and retrieving element attributes. ```APIDOC ## Attribute Operations ### Description Methods for setting, getting, and retrieving element attributes. ### Methods - `set_attribute(name, value)`: Set an attribute of the element. - `get_attribute(name)`: Get the value of a specific attribute. - `get_all_attributes()`: Get all attributes of the element. ``` -------------------------------- ### Content Retrieval Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for getting text, HTML, or value content from an element. ```APIDOC ## Content Retrieval Operations ### Description Methods for getting text, HTML, or value content from an element. ### Methods - `get_text()`: Get the text content of the element. - `get_html()`: Get the HTML content of the element. - `get_value()`: Get the value of the element. - `set_value(value)`: Set the value of the element. ``` -------------------------------- ### Get Value of Web Element Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Retrieves the current value of a web element, typically used for input fields. Use this to get the current state of an input. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') value = browser.find('输入框').get_value() ``` -------------------------------- ### set_column(col_name, values, begin_row_num=1) Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Writes content to a specified column in the data table, starting from a given row number. The `values` must be a list. ```APIDOC ## set_column(col_name, values, begin_row_num=1) ### Description Writes content to a specified column in the data table, starting from a given row number. The `values` must be a list. ### Parameters #### Path Parameters - **col_name** (str) - Required - The name of the column to write to. - **values** (List) - Required - The values to write, must be a list. - **begin_row_num** (int) - Optional - The starting row number for writing. Defaults to 1. ### Returns - None ### Example ```python from xbot import app def main(args): app.databook.set_column('A', [0,1,2,3,4,5,6,7,8,9], begin_row_num=1) ``` ``` -------------------------------- ### Get Image Selector Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Retrieves an image selector object based on its name from the image library. Use this to capture image elements. ```python from .package import * def main(args): selector = package.image_selector('图像1') # 这里"图像1"指的是图像库中名称为"图像1"的图像元素 ``` -------------------------------- ### insert_row(row_num, values, begin_column_name='A') Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Inserts a new row of content at a specified position in the data table. The `values` must be a list, and the insertion can start from a specified column. ```APIDOC ## insert_row(row_num, values, begin_column_name='A') ### Description Inserts a new row of content at a specified position in the data table. The `values` must be a list, and the insertion can start from a specified column. ### Parameters #### Path Parameters - **row_num** (int) - Required - The row number at which to insert (1-based). - **values** (List) - Required - The values to set, must be a list. - **begin_column_name** (str) - Optional - The starting column name for insertion. Defaults to 'A'. ### Returns - None ### Example ```python from xbot import app def main(args): app.databook.insert_row(10, [0,1,2,3,4,5,6,7,8,9], begin_column_name='A') ``` ``` -------------------------------- ### Get Row Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Retrieves the content of a specific row from the data table. Row numbers are 1-based. ```python from xbot import app def main(args): list_value = app.databook.get_row(1) print(list_value) ``` -------------------------------- ### Get Element Selector Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Retrieves an element selector object based on its name from the element library. Use this to capture web or software elements. ```python from .package import * def main(args): # 这里"百度一下"指的是元素库中名为"百度一下"的网页元素 selector = package.selector('百度一下') print(selector) ``` -------------------------------- ### Set Column Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Writes a list of values to a specific column in the data table, starting from a specified row. Values must be a list. ```python from xbot import app def main(args): app.databook.set_column('A', [0,1,2,3,4,5,6,7,8,9], begin_row_num=1) ``` -------------------------------- ### Get Text Content of Web Element Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Retrieves the visible text content of a web element. Use this to extract textual data from the page. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') value = browser.find('输入框').get_text() ``` -------------------------------- ### set_row(row_num, values, begin_column_name='A') Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Writes row content to a specified row in the data table. The `values` must be a list of strings, and the operation can start from a specified column. ```APIDOC ## set_row(row_num, values, begin_column_name='A') ### Description Writes row content to a specified row in the data table. The `values` must be a list of strings, and the operation can start from a specified column. ### Parameters #### Path Parameters - **row_num** (int) - Required - The row number to set (1-based). - **values** (List[str]) - Required - The values to set, must be a list of strings. - **begin_column_name** (str) - Optional - The starting column name for writing. Defaults to 'A'. ### Returns - None ### Example ```python from xbot import app def main(args): app.databook.set_row(1, ['hello world'], begin_column_name='A') ``` ``` -------------------------------- ### Get Row Count Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Retrieves the total number of rows that currently contain data in the data table. ```python from xbot import app def main(args): count = app.databook.get_row_count() print(count) ``` -------------------------------- ### Get Range Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Retrieves data from a specified rectangular area within the data table. Both row and column numbers/names are 1-based. ```python from xbot import app def main(args): list_value = app.databook.get_range(1, 'A', 3, 'F') print(list_value) ``` -------------------------------- ### Get Cell Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Retrieves the content of a specific cell in the data table using its row number and column name. ```python from xbot import app def main(args): value = app.databook.get_cell(2, 'B') print(value) ``` -------------------------------- ### Get HTML Content of Web Element Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Retrieves the complete HTML content of a web element. Useful for inspecting the element's structure or attributes. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') html = browser.find("百度一下").get_html() ``` -------------------------------- ### Set Row Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Writes content to a specific row in the data table, optionally starting from a specified column. Values must be a list of strings. ```python from xbot import app def main(args): app.databook.set_row(1, ['hello world'], begin_column_name='A') ``` -------------------------------- ### Set Range Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Writes a 2D array of values to a specified range within the data table, starting from a given row and column. ```python from xbot import app def main(args): app.databook.set_range(1, 'A', [['1','2','3'],['a','b','c']]) ``` -------------------------------- ### Append Row Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Appends a new row to the end of the data table. You can specify the starting column for the new data. ```python from xbot import app def main(args): app.databook.append_row([1,2,3,4,5,6,7,8,9,0], begin_column_name='B') ``` -------------------------------- ### append_row(values, begin_column_name='A') Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Appends a new row of content to the end of the data table. The `values` must be a list, and the append can start from a specified column. ```APIDOC ## append_row(values, begin_column_name='A') ### Description Appends a new row of content to the end of the data table. The `values` must be a list, and the append can start from a specified column. ### Parameters #### Path Parameters - **values** (List) - Required - The values to set, must be a list. - **begin_column_name** (str) - Optional - The starting column name for appending. Defaults to 'A'. ### Returns - None ### Example ```python from xbot import app def main(args): app.databook.append_row([1,2,3,4,5,6,7,8,9,0], begin_column_name='B') ``` ``` -------------------------------- ### Insert Row Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Inserts a new row at a specified position in the data table. You can also specify the starting column for the inserted data. ```python from xbot import app def main(args): app.databook.insert_row(10, [0,1,2,3,4,5,6,7,8,9], begin_column_name='A') ``` -------------------------------- ### set_range(row_num, col_name, values) Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Writes content to a specified rectangular area within the data table, starting from a given row number and column name. The `values` must be a 2D array. ```APIDOC ## set_range(row_num, col_name, values) ### Description Writes content to a specified rectangular area within the data table, starting from a given row number and column name. The `values` must be a 2D array. ### Parameters #### Path Parameters - **row_num** (int) - Required - The starting row number for writing (1-based). - **col_name** (str) - Required - The starting column name for writing (e.g., 'A'). - **values** (List[List]) - Required - The content to write, must be a 2D array. ### Returns - None ### Example ```python from xbot import app def main(args): app.databook.set_range(1, 'A', [['1','2','3'],['a','b','c']]) ``` ``` -------------------------------- ### get_range(area_begin_row_num, area_begin_column_name, area_end_row_num, area_end_column_name) Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Retrieves content from a specified rectangular area within the data table, defined by start and end row numbers and column names. ```APIDOC ## get_range(area_begin_row_num, area_begin_column_name, area_end_row_num, area_end_column_name) ### Description Retrieves content from a specified rectangular area within the data table, defined by start and end row numbers and column names. ### Parameters #### Path Parameters - **area_begin_row_num** (int) - Required - The starting row number of the area (1-based). - **area_begin_column_name** (str) - Required - The starting column name of the area (e.g., 'A'). - **area_end_row_num** (int) - Required - The ending row number of the area (1-based). - **area_end_column_name** (str) - Required - The ending column name of the area (e.g., 'F'). ### Returns - **List[Tuple]**: A list of tuples representing the data within the specified area. ### Example ```python from xbot import app def main(args): list_value = app.databook.get_range(1, 'A', 3, 'F') print(list_value) ``` ``` -------------------------------- ### Add Resources to Clipboard Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Adds specified resource files to the clipboard. The input must be a list of filenames. ```python from . import package def main(args): package.resources.add_to_clipboard(['123.txt', '234.xml']) ``` -------------------------------- ### resources.add_to_clipboard(filenames) Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Adds resource files to the clipboard. ```APIDOC ## add_to_clipboard(filenames) ### Description Adds resource files to the clipboard. ### Method add_to_clipboard ### Parameters #### Path Parameters - **filenames** (list of strings) - Required - A list of resource filenames (e.g., `['123.txt', '234.xml']`). ### Response #### Success Response - None ### Request Example ```python from . import package def main(args): package.resources.add_to_clipboard(['123.txt', '234.xml']) ``` ``` -------------------------------- ### resources.copy_to(filename, dest_filename) Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Copies the content of a resource file to a destination file. ```APIDOC ## copy_to(filename, dest_filename) ### Description Copies the content of a resource file to the destination file. ### Method copy_to ### Parameters #### Path Parameters - **filename** (string) - Required - The name of the resource file. - **dest_filename** (string) - Required - The destination path where the resource file content will be copied (e.g., "D:\\123.txt"). ### Response #### Success Response - None ### Request Example ```python from . import package def main(args): package.resources.copy_to('123.txt', 'D:\\aaa.txt') ``` ``` -------------------------------- ### Clipboard Input with Anchor and Offset Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Fills a web input field using the clipboard, with an option to specify an anchor point and offset for the initial click. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') input_element = browser.find('输入框') input_element.clipboard_input('hello world', append=True, anchor=('topLeft', 100, 100)) ``` -------------------------------- ### Copy Resource File Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Copies the content of a resource file to a specified destination file path. Ensure the destination path is absolute. ```python from . import package def main(args): package.resources.copy_to('123.txt', 'D:\\aaa.txt') ``` -------------------------------- ### File Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for uploading and downloading files associated with elements. ```APIDOC ## File Operations ### Description Methods for uploading and downloading files associated with elements. ### Methods - `upload(filepath)`: Upload a file to an element (e.g., file input). - `download(filepath)`: Download a file associated with an element. ``` -------------------------------- ### input Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Fills a web input field with specified text. Supports simulating human input and appending text. ```APIDOC ## input(text, simulative=True, append=False, contains_hotkey=False, send_key_delay=50, focus_timeout=1000, delay_after=1, anchor=None) ### Description Fills a web input field with the provided text. Can simulate human input and append to existing content. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **text** (string) - Required - The text content to input into the field. - **simulative** (boolean) - Optional - Whether to simulate human clicks, defaults to True. - **append** (boolean) - Optional - Whether to append input, defaults to False. - **contains_hotkey** (boolean) - Optional - Whether the input contains hotkeys, defaults to False. - **send_key_delay** (integer) - Optional - Delay between key presses in milliseconds, defaults to 50. - **focus_timeout** (integer) - Optional - Timeout for focus acquisition and input operation in milliseconds, defaults to 1000. - **delay_after** (integer) - Optional - Delay after execution in seconds, defaults to 1. - **anchor** (tuple) - Optional - Anchor for mouse click position and offset, defaults to None (center click with no offset). - **anchor structure**: (position, offset_x, offset_y) - **position options**: 'topLeft', 'topCenter', 'topRight', 'middleLeft', 'middleCenter', 'middleRight', 'bottomLeft', 'bottomCenter', 'bottomRight' ### Request Example ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') input_element = browser.find('输入框') input_element.input('影刀') ``` ### Response #### Success Response (200) - None #### Response Example None ``` -------------------------------- ### resources.get_bytes(filename) Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Retrieves the binary information of a resource file. ```APIDOC ## get_bytes(filename) ### Description Gets the binary information of a resource file. ### Method get_bytes ### Parameters #### Path Parameters - **filename** (string) - Required - The name of the resource file. ### Response #### Success Response - **byte** (byte) - Returns the binary information of the resource file. ### Request Example ```python from . import package def main(args): value = package.resources.get_bytes('123.txt') # The output will be returned in binary format print(value) ``` ``` -------------------------------- ### focus Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Selects (activates) the current element, making it the active element on the page. ```APIDOC ## focus() ### Description Selects (activates) the current element, making it the active element on the page. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') browser.find('输入框').focus() ``` ### Response #### Success Response (200) - None #### Response Example None ``` -------------------------------- ### handle_save_dialog Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Handles the save dialog for web downloads, allowing confirmation or cancellation and specifying the save location and filename. ```APIDOC ## handle_save_dialog(file_folder, dialog_result='ok', mode='cef', *, file_name=None, wait_appear_timeout=20, focus_timeout=600) ### Description Handles the save dialog for web downloads, allowing confirmation or cancellation and specifying the save location and filename. ### Parameters #### Path Parameters - **file_folder** (string) - Required - The folder where the file will be saved. - **dialog_result** (string) - Optional - The action to take on the dialog ('ok' to confirm, 'cancel' to cancel). Defaults to 'ok'. #### Query Parameters - **mode** (string) - Optional - The browser type. Defaults to 'cef'. - **file_name** (string) - Optional - The name for the saved file. Defaults to None (auto-generated unique name). - **wait_appear_timeout** (integer) - Optional - Timeout in seconds for the dialog to appear. Defaults to 20. - **focus_timeout** (integer) - Optional - Timeout in milliseconds for focus. Defaults to 600. ### Response #### Success Response (200) - No specific return value documented. ``` -------------------------------- ### resources.get_text(filename, encoding='utf-8') Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Retrieves the text content of a resource file, with support for specifying the encoding. ```APIDOC ## get_text(filename, encoding='utf-8') ### Description Gets the text content of a resource file. ### Method get_text ### Parameters #### Path Parameters - **filename** (string) - Required - The name of the resource file. - **encoding** (string) - Optional - The encoding format when reading the file. Defaults to 'utf-8'. ### Response #### Success Response - **str** (string) - Returns the text content of the resource file. ### Request Example ```python from . import package def main(args): text = package.resources.get_text('123.txt') print(text) ``` ``` -------------------------------- ### Input Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for interacting with input fields and activating elements. ```APIDOC ## Input Operations ### Description Methods for interacting with input fields and activating elements. ### Methods - `input(text)`: Fill the input field with the given text. - `clipboard_input(text)`: Input text using the clipboard. - `focus()`: Activate the element (bring it into focus). ``` -------------------------------- ### Handle Save Dialog Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Manages the web page download save dialog, allowing confirmation or cancellation and specifying file details. Useful for automating file downloads. ```python from xbot import web def main(args): web.handle_save_dialog('D:\\', 'ok', 'chrome', file_name='123.txt', wait_appear_timeout=20) ``` -------------------------------- ### Handle Upload Dialog Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Handles the web page upload dialog, allowing confirmation or cancellation of file uploads. Use this to automate file selection for uploads. ```python from xbot import web def main(args): web.handle_upload_dialog('D:\\123.txt', 'ok', 'chrome', wait_appear_timeout=20) ``` -------------------------------- ### Dropdown Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for selecting options from dropdowns and retrieving selection information. ```APIDOC ## Dropdown Operations ### Description Methods for selecting options from dropdowns and retrieving selection information. ### Methods - `select(option_text)`: Select a single option from the dropdown by its text. - `select_multiple(option_texts)`: Select multiple options from the dropdown by their text. - `select_by_index(index)`: Select a single option by its index. - `select_multiple_by_index(indices)`: Select multiple options by their indices. - `get_select_options()`: Get all available options in the dropdown. - `get_all_select_items()`: Get all items in the dropdown. - `get_selected_item()`: Get the currently selected item in the dropdown. ``` -------------------------------- ### get_html Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Retrieves the HTML content of the current web element. ```APIDOC ## get_html() ### Description Retrieves the HTML content of the current web element. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') html = browser.find("百度一下").get_html() ``` ### Response #### Success Response (200) - **str** - The HTML content of the current web element. #### Response Example ```json { "example": "..." } ``` ``` -------------------------------- ### Input Text with Anchor and Offset Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Fills a web input field with text, allowing specification of an anchor point and offset for the click action before input. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') input_element = browser.find('输入框') input_element.input('hello world', anchor=('topLeft', 100, 100)) ``` -------------------------------- ### Focus Web Element Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Selects and activates a web element, making it the active element for interaction. Useful for ensuring an element is ready for input. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') browser.find('输入框').focus() ``` -------------------------------- ### Element Relationship Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for navigating and retrieving parent and child elements, as well as siblings. ```APIDOC ## Element Relationship Operations ### Description Methods for navigating and retrieving parent and child elements, as well as siblings. ### Methods - `parent()`: Get the parent element. - `children()`: Get all child elements. - `child_at(index)`: Get the child element at a specific position. - `previous_sibling()`: Get the previous sibling element. - `next_sibling()`: Get the next sibling element. ``` -------------------------------- ### Drag Web Element to Position Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Simulates dragging a web element to a specified position with smooth scrolling. Use when precise element positioning is required. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') browser.find('可移动元素').drag_to(simulative=True, behavior='smooth', top=100, left=100) ``` -------------------------------- ### Screenshot Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for taking screenshots of elements. ```APIDOC ## Screenshot Operations ### Description Methods for taking screenshots of elements. ### Methods - `screenshot(filepath)`: Save a screenshot of the element to a file. - `screenshot_to_clipboard()`: Copy a screenshot of the element to the clipboard. ``` -------------------------------- ### Position Finding Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for finding the first available column or row based on specified criteria. ```APIDOC ## Position Finding ### `get_first_free_column()` **Description**: Finds the first available (empty) column in the worksheet. ### `get_first_free_column_on_row()` **Description**: Finds the first available (empty) column on a specified row. ### `get_first_free_row()` **Description**: Finds the first available (empty) row in the worksheet. ### `get_first_free_row_on_column()` **Description**: Finds the first available (empty) row on a specified column. ``` -------------------------------- ### clipboard_input Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Fills a web input field using the clipboard, which can help avoid input method issues. Supports appending text. ```APIDOC ## clipboard_input(text, append=False, delay_after=1, anchor=None, focus_timeout=1000) ### Description Fills a web input field using the clipboard, which can effectively avoid input method issues. Supports appending text. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **text** (string) - Required - The text content to input into the field. - **append** (boolean) - Optional - Whether to append input, defaults to False. - **delay_after** (integer) - Optional - Delay after execution in seconds, defaults to 1. - **anchor** (tuple) - Optional - Anchor for mouse click position and offset, defaults to None (center click with no offset). - **anchor structure**: (position, offset_x, offset_y) - **position options**: 'topLeft', 'topCenter', 'topRight', 'middleLeft', 'middleCenter', 'middleRight', 'bottomLeft', 'bottomCenter', 'bottomRight' - **focus_timeout** (integer) - Optional - Timeout for focus acquisition and input operation in milliseconds, defaults to 1000. ### Request Example ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') input_element = browser.find('输入框') input_element.clipboard_input('hello world', append=True) ``` ### Response #### Success Response (200) - None #### Response Example None ``` -------------------------------- ### Input Text into Web Input Field Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Fills a web input field with specified text. Supports simulating human input and appending text. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') input_element = browser.find('输入框') input_element.input('影刀') ``` -------------------------------- ### handle_upload_dialog Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Handles the upload dialog for web pages, allowing confirmation or cancellation of file uploads. ```APIDOC ## handle_upload_dialog(filename, dialog_result='ok', mode='cef', *, wait_appear_timeout=20) ### Description Handles the upload dialog for web pages, allowing confirmation or cancellation of file uploads. ### Parameters #### Path Parameters - **filename** (string) - Required - The path to the file to be uploaded. - **dialog_result** (string) - Optional - The action to take on the dialog ('ok' to confirm, 'cancel' to cancel). Defaults to 'ok'. #### Query Parameters - **mode** (string) - Optional - The browser type. Defaults to 'cef'. - **wait_appear_timeout** (integer) - Optional - Timeout in seconds for the dialog to appear. Defaults to 20. ### Response #### Success Response (200) - No specific return value documented. ``` -------------------------------- ### get_value Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Retrieves the value of the current web element. ```APIDOC ## get_value() ### Description Retrieves the value of the current web element. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') value = browser.find('输入框').get_value() ``` ### Response #### Success Response (200) - **str** - The value of the current web element. #### Response Example ```json { "example": "element value" } ``` ``` -------------------------------- ### drag_to Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Drags a web element to a specified position on the page. Supports simulation of human interaction and different scrolling behaviors. ```APIDOC ## drag_to(simulative=True, behavior='smooth', top=0, left=0, delay_after=1) ### Description Drags a web element to a specified position. Supports simulating human clicks and different scrolling behaviors. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **simulative** (boolean) - Optional - Whether to simulate human clicks, defaults to True. - **behavior** (string) - Optional - Web scrolling effect, can be 'instant' or 'smooth', defaults to 'smooth'. - **top** (integer) - Optional - The vertical coordinate to scroll to, defaults to 0. - **left** (integer) - Optional - The horizontal coordinate to scroll to, defaults to 0. - **delay_after** (integer) - Optional - Delay after command execution, defaults to 1 second. ### Request Example ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') browser.find('可移动元素').drag_to(simulative=True, behavior='smooth', top=100, left=100) ``` ### Response #### Success Response (200) - None #### Response Example None ``` -------------------------------- ### Mouse Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for performing mouse interactions on elements. ```APIDOC ## Mouse Operations ### Description Methods for performing mouse interactions on elements. ### Methods - `click()`: Perform a single click on the element. - `dblclick()`: Perform a double-click on the element. - `hover()`: Hover the mouse over the element. - `drag_to(target_element)`: Drag and drop the element to a target element. ``` -------------------------------- ### get_text Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Retrieves the text content of the current web element. ```APIDOC ## get_text() ### Description Retrieves the text content of the current web element. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') value = browser.find('输入框').get_text() ``` ### Response #### Success Response (200) - **str** - The text content of the current web element. #### Response Example ```json { "example": "text content" } ``` ``` -------------------------------- ### Checkbox Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for checking and verifying the state of checkboxes. ```APIDOC ## Checkbox Operations ### Description Methods for checking and verifying the state of checkboxes. ### Methods - `check()`: Check the checkbox. - `is_checked()`: Check if the checkbox is selected. ``` -------------------------------- ### set_value Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Sets the value of the current web element. ```APIDOC ## set_value(value) ### Description Sets the value of the current web element. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **value** (string) - Required - The text value to set for the web element. ### Request Example ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') browser.find('输入框').set_value('hello world') ``` ### Response #### Success Response (200) - None #### Response Example None ``` -------------------------------- ### Clipboard Input into Web Input Field Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Fills a web input field using the clipboard, which can help avoid input method issues. Supports appending text. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') input_element = browser.find('输入框') input_element.clipboard_input('hello world', append=True) ``` -------------------------------- ### selector(name) Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Retrieves a selector object for a given element name from the element library. This is used for web or software elements. ```APIDOC ## selector(name) ### Description Gets a selector object based on the element name from the element library. The selector refers to web or software elements captured in the element library. ### Method selector ### Parameters #### Path Parameters - **name** (string) - Required - The name of the selector, which is the name of the element in the element library. ### Response #### Success Response - **Selector** (object) - An element selector object, which is the element specified by the element name. ### Request Example ```python from .package import * def main(args): # Here "Baidu" refers to the web element named "Baidu" in the element library selector = package.selector('Baidu') print(selector) ``` ``` -------------------------------- ### clear() Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Clears all content from the data table. ```APIDOC ## clear() ### Description Clears all content from the data table. ### Parameters - None ### Returns - None ### Example ```python from xbot import app def main(args): app.databook.clear() ``` ``` -------------------------------- ### Table Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for extracting data from HTML tables. ```APIDOC ## Table Operations ### Description Methods for extracting data from HTML tables. ### Methods - `extract_table()`: Extract data from an HTML table element. ``` -------------------------------- ### Set Value of Web Element Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Sets the value of a web element, typically an input field. Use this to programmatically change the content of an input. ```python from xbot import web def main(args): browser = web.create('www.baidu.com', 'chrome') browser.find('输入框').set_value('hello world') ``` -------------------------------- ### Information Retrieval Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for retrieving information about the worksheet, such as row count, column count, and sheet name. ```APIDOC ## Information Retrieval ### `get_row_count()` **Description**: Retrieves the total number of rows in the worksheet. ### `get_column_count()` **Description**: Retrieves the total number of columns in the worksheet. ### `get_name()` **Description**: Retrieves the name of the worksheet. ``` -------------------------------- ### State Judgment Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.Element.md Methods for checking the enabled and displayed state of an element. ```APIDOC ## State Judgment Operations ### Description Methods for checking the enabled and displayed state of an element. ### Methods - `is_enabled()`: Check if the element is enabled. - `is_displayed()`: Check if the element is visible. ``` -------------------------------- ### Data Reading Methods Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for reading data from a worksheet. These functions allow retrieval of content from specific cells, rows, columns, or defined ranges. ```APIDOC ## Data Reading ### `get_cell()` **Description**: Retrieves the content of a specified cell. ### `get_row()` **Description**: Retrieves the content of a specified row. ### `get_column()` **Description**: Retrieves the content of a specified column. ### `get_range()` **Description**: Retrieves the content of a specified range of cells. ``` -------------------------------- ### Data Writing Methods Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for writing data to a worksheet. These functions enable writing content to individual cells, entire rows, columns, or specific ranges. ```APIDOC ## Data Writing ### `set_cell()` **Description**: Writes content to a specified cell. ### `set_row()` **Description**: Writes content to a specified row. ### `set_column()` **Description**: Writes content to a specified column. ### `set_range()` **Description**: Writes content to a specified range of cells. ``` -------------------------------- ### image_selector(name) Source: https://github.com/jimixy/yingdaoapi/blob/main/package.md Retrieves an image selector object based on the name of an image element from the image library. ```APIDOC ## image_selector(name) ### Description Gets an image selector object based on the name of an image element from the image library. ### Method image_selector ### Parameters #### Path Parameters - **name** (string) - Required - The name of the image selector, which is the name of the image element in the image library. ### Response #### Success Response - **ImageSelector** (object) - An image selector object, which is the element specified by the image element name. ### Request Example ```python from .package import * def main(args): selector = package.image_selector('Image1') # Here "Image1" refers to the image element named "Image1" in the image library ``` ``` -------------------------------- ### Content Management Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for managing the content of a worksheet, including clearing all content or specific ranges. ```APIDOC ## Content Management ### `clear()` **Description**: Clears all content from the worksheet. ### `clear_range()` **Description**: Clears content within a specified range of the worksheet. ``` -------------------------------- ### Column Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for manipulating columns within a worksheet, including inserting and removing columns. ```APIDOC ## Column Operations ### `remove_column()` **Description**: Removes a column at a specified position from the worksheet. ### `insert_column()` **Description**: Inserts a new column at a specified position within the worksheet. ``` -------------------------------- ### Display Control Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for controlling the display properties of rows and columns, such as setting them to hidden. ```APIDOC ## Display Control ### `set_row_hidden()` **Description**: Sets the hidden attribute for a specified row. ### `set_column_hidden()` **Description**: Sets the hidden attribute for a specified column. ``` -------------------------------- ### close_all Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Closes all open web pages in the specified browser mode. Optionally, it can terminate the browser process. ```APIDOC ## close_all(mode='cef', task_kill=False) ### Description Closes all open web pages in the specified browser mode. Optionally, it can terminate the browser process. ### Parameters #### Query Parameters - **mode** (string) - Optional - The browser type. Defaults to 'cef'. - **task_kill** (boolean) - Optional - Whether to terminate the browser process. Defaults to False. ### Response #### Success Response (200) - No specific return value documented. ``` -------------------------------- ### Set Browser Cookie Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Sets a cookie for a specified URL in a given browser mode. Useful for managing session data or site preferences. ```python from xbot import web def main(args): web.set_cookie('https://www.baidu.com', mode="chrome", name="test") pass ``` -------------------------------- ### get_row_count() Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Retrieves the total number of rows with data in the data table. ```APIDOC ## get_row_count() ### Description Retrieves the total number of rows with data in the data table. ### Parameters - None ### Returns - **int**: The total number of rows containing data. ### Example ```python from xbot import app def main(args): count = app.databook.get_row_count() print(count) ``` ``` -------------------------------- ### get_row(row_num) Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Retrieves the content of a specified row from the data table. Row numbers are 1-based. ```APIDOC ## get_row(row_num) ### Description Retrieves the content of a specified row from the data table. Row numbers are 1-based. ### Parameters #### Path Parameters - **row_num** (int) - Required - The row number to retrieve (1-based). ### Returns - **List[str]**: A list of strings representing the content of the retrieved row. ### Example ```python from xbot import app def main(args): list_value = app.databook.get_row(1) print(list_value) ``` ``` -------------------------------- ### Clear Data Table Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Removes all content from the data table. ```python from xbot import app def main(args): app.databook.clear() ``` -------------------------------- ### Range Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for performing operations on specific ranges within the worksheet, including selection, copying, and pasting. ```APIDOC ## Range Operations ### `select_range()` **Description**: Selects a specified range within the worksheet. ### `copy_range()` **Description**: Copies a specified range to the system clipboard. ### `paste_range_ex()` **Description**: Pastes content from the system clipboard to a specified range with extended functionality. Note: `paste_range()` is deprecated. ``` -------------------------------- ### set_cell(row_num, col_name, value) Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Writes content to a specific cell in the data table, identified by its row number and column name. ```APIDOC ## set_cell(row_num, col_name, value) ### Description Writes content to a specific cell in the data table, identified by its row number and column name. ### Parameters #### Path Parameters - **row_num** (int) - Required - The row number of the cell. - **col_name** (str) - Required - The column name of the cell. - **value** (any) - Required - The content to write to the cell. ### Returns - None ### Example ```python from xbot import app def main(args): app.databook.set_cell(1, 'A', 'hello') ``` ``` -------------------------------- ### set_cookie Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Sets cookie information for a given URL in a specified browser mode. Cookies can be session-based or persistent with an expiration time. ```APIDOC ## set_cookie(url, mode='cef', name=None, value=None, sessionCookie=True, expires=100, domain=None, path=None, httpOnly=False, secure=False) ### Description Sets cookie information for a given URL in a specified browser mode. Cookies can be session-based or persistent with an expiration time. ### Parameters #### Path Parameters - **url** (string) - Required - The URL for which to set the cookie. - **name** (string) - Required - The name of the cookie to set. #### Query Parameters - **mode** (string) - Optional - The browser type (e.g., 'cef', 'chrome'). Defaults to 'cef'. - **value** (string) - Optional - The value of the cookie. - **sessionCookie** (boolean) - Optional - Whether to set as a session cookie. Defaults to True. - **expires** (integer) - Optional - Expiration time for persistent cookies in seconds. Defaults to 100. - **domain** (string) - Optional - The domain for the cookie. - **path** (string) - Optional - The path for the cookie. - **httpOnly** (boolean) - Optional - Whether the cookie should be marked as HttpOnly. Defaults to False. - **secure** (boolean) - Optional - Whether the cookie should be marked as Secure. Defaults to False. ### Response #### Success Response (200) - No specific return value documented. ``` -------------------------------- ### Set Cell Content Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Writes content to a specific cell in the data table, identified by its row number and column name. ```python from xbot import app def main(args): app.databook.set_cell(1, 'A', 'hello') ``` -------------------------------- ### Row Operations Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.excel.WorkSheet.md Methods for manipulating rows within a worksheet, including appending, inserting, and removing rows. ```APIDOC ## Row Operations ### `append_row()` **Description**: Appends a new row with provided content to the end of the worksheet. ### `insert_row()` **Description**: Inserts a new row at a specified position within the worksheet. ### `remove_row()` **Description**: Removes a row at a specified position from the worksheet. ``` -------------------------------- ### get_cell(row_num, col_name) Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Retrieves the content of a specific cell in the data table, identified by its row number and column name. ```APIDOC ## get_cell(row_num, col_name) ### Description Retrieves the content of a specific cell in the data table, identified by its row number and column name. ### Parameters #### Path Parameters - **row_num** (int) - Required - The row number of the cell. - **col_name** (str) - Required - The column name of the cell. ### Returns - **str**: The content of the specified cell. ### Example ```python from xbot import app def main(args): value = app.databook.get_cell(2, 'B') print(value) ``` ``` -------------------------------- ### Close All Browser Tabs Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Closes all open web pages in a specified browser mode. Optionally, it can terminate the browser process. ```python from xbot import web def main(args): web.close_all('chrome') ``` -------------------------------- ### Remove Browser Cookie Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Removes a cookie by its URL and name from a specified browser. Use this to clear specific cookies for a website. ```python from xbot import web def main(args): web.remove_cookie('https://www.baidu.com', 'BIDUPSID', 'edge') pass ``` -------------------------------- ### remove_cookie Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.web.md Removes a cookie specified by its URL and name from the browser. ```APIDOC ## remove_cookie(url, name, mode='cef') ### Description Removes a cookie specified by its URL and name from the browser. ### Parameters #### Path Parameters - **url** (string) - Required - The URL associated with the cookie to be removed. - **name** (string) - Required - The name of the cookie to be removed. #### Query Parameters - **mode** (string) - Optional - The browser type. Defaults to 'cef'. ### Response #### Success Response (200) - No specific return value documented. ``` -------------------------------- ### remove_row(row_num) Source: https://github.com/jimixy/yingdaoapi/blob/main/xbot.app.databook.md Deletes a specified row from the data table. ```APIDOC ## remove_row(row_num) ### Description Deletes a specified row from the data table. ### Parameters #### Path Parameters - **row_num** (int) - Required - The row number to remove. ### Returns - None ### Example ```python from xbot import app def main(args): app.databook.remove_row(2) ``` ```