F(x)

更新时间:
复制 MD 格式

create

create(url, wait=True, timeout=100, edge_path=None)

Method description

Creates an Edge object.

Parameters

url<str> The URL to open.

wait<bool> Specifies whether to wait for the page to load.

timeout<int> The timeout in seconds. The default value is 100.

edge_path<str> The path to the edge.exe file. By default, the system searches the %ProgramFiles% and %ProgramFiles(x86)% directories.

Return value

Returns a ChromeTab object <ChromeTab>.

Example call rpa.app.edge.create

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled.
# The following code provides an example:
page = rpa.app.edge.create('www.aliyun.com')

catch

catch(name, mode='title', pattern='contain', timeout=10)

Method description

Catches an open page.

Parameters

name<str> The title or URL of the page.

mode<str> The property of the page to match.

Options:

  • Title: title

  • URL: url

pattern<str> The page matching pattern.

Options:

  • equal: Exact match.

  • contain: Contains match.

  • regular: Regular expression match.

Return value

Returns a Browser object <ChromeTab>.

Example call rpa.app.edge.catch

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled. Also, confirm that the target webpage is already open.
# The following code provides an example:
page = rpa.app.edge.catch('Alibaba Cloud')

catch_specific_pages

catch_specific_pages(name, mode='title', pattern='contain')

Method description

Catches all pages that match the specified criteria.

Parameters

name<str> The title or URL of the page.

mode<str> The property of the page to match.

Options:

  • title: title

  • URL: URL

pattern<str> The page matching pattern.

Options:

  • equal: Exact match.

  • contain: Contains match.

  • regular: Regular expression match.

Return value

Returns a list of Browser objects <list>.

Example call rpa.app.edge.catch_specific_pages

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled. Also, confirm that at least one webpage that meets the conditions is open.
# The following code provides an example:
page_list = rpa.app.edge.catch_specific_pages('Alibaba Cloud')

catch_all_pages

catch_all_pages()

Method description

This operation returns all pages.

Example call rpa.app.edge.catch_all_pages

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled.
# The following code provides an example:
page_list = rpa.app.edge.catch_all_pages()

catch_activated_pages

catch_activated_pages()

Method description

Retrieves all active pages.

Example call rpa.app.edge.catch_activated_pages

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled.
# If you have multiple Edge browser windows open, each with multiple tabs, use this method to return the active tab from each window.
# The following code provides an example:
page_list = rpa.app.edge.catch_activated_pages()

close_all

close_all()

Method description

Closes all pages.

Example call rpa.app.edge.close_all

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled.
# The following code provides an example:
rpa.app.edge.close_all()

maximize

maximize()

Method description

Maximizes the browser window.

Example call rpa.app.edge.maximize

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled.
# If multiple Edge browser windows are open, this method maximizes only one of them.
# The following code provides an example:
rpa.app.edge.maximize()

get_cookies

get_cookies(url=None, domain=None, name=None)

Method description

Retrieves a set of cookies.

Parameters

url<str> Restricts the retrieved cookies to those that match the specified URL.

domain<str> Restricts the retrieved cookies to those that match the specified domain or its subdomains.

name<str> Filters cookies by name.

Return value

Returns a list of matching cookies <list>.

Example call rpa.app.edge.get_cookies

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled.
# The url parameter must be a complete URL, including the protocol.
# The following code provides an example:
cookies = rpa.app.edge.get_cookies(url='https://www.aliyun.com')

remove_cookie

remove_cookie(url, name)

Method description

Deletes a cookie.

Parameters

url<str> The URL associated with the cookie.

name<str> The name of the cookie to delete.

Example call rpa.app.edge.remove_cookie

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled.
# The url parameter must be a complete URL, including the protocol.
# The following code provides an example:
rpa.app.edge.remove_cookie('https://www.baidu.com','domain')

set_cookie

set_cookie(url, name, domain=None, value=None, path=None, secure=False, http_only=False, expiration_date=None)

Method description

Sets a cookie.

Parameters

url<str> The URL to associate with the cookie.

name<str> The name of the cookie.

domain<str> The domain of the cookie. If omitted, the cookie becomes a host-only cookie.

value<str> The value of the cookie. If this parameter is omitted, the value is empty.

path<str> The path of the cookie. The default value is the path component of the url parameter.

secure<bool> Specifies whether the cookie should be marked as secure.

http_only<bool> Specifies whether the cookie should be marked as http_only.

expiration_date<str> The expiration date of the cookie.

Example call rpa.app.edge.set_cookie

# Note: Before using this method, confirm that the Aliyun RPA extension for Edge is installed and enabled.
# The url parameter must be a complete URL, including the protocol.
# The following code provides an example:
rpa.app.edge.set_cookie('https://www.baidu.com','rpa_test',value='Alibaba Cloud RPA Test_www.aliyun.com')