F(x)
create
create(url, wait=True, timeout=100, edge_path=None)
Description
Creates an EdgeTab object to manage a new Edge browser page.
Parameters
url<str> The URL to open.
wait<bool> Specifies whether to wait for the page to finish loading.
timeout<int> The wait timeout in seconds. Defaults to 100.
edge_path<str> The path to the msedge.exe file.
If set to
None, the method automatically searches the%ProgramFiles%and%ProgramFiles(x86)%directories.If provided, the value must be the full path to
msedge.exe, for example,C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe.
Return Value
Returns an EdgeTab object.<EdgeTab>
Example- rpa.app.edge.create-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# Example:
page = rpa.app.edge.create('www.aliyun.com')catch
catch(name, mode='title', pattern='contain', timeout=10)
Description
Catches an already open page that matches the specified criteria.
Parameters
name<str> The title or URL to match.
mode<str> The page attribute to match.
Options:
title: Matches the page title.url: Matches the page URL.
pattern<str> The matching pattern.
Options:
equal: exact match.contain: substring match.regular: regular expression match.
Return Value
Returns an EdgeTab object.<EdgeTab>
Example- rpa.app.edge.catch-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled. The target page must be open before using this method.
# Example:
page = rpa.app.edge.catch('Alibaba Cloud')catch_specific_pages
catch_specific_pages(name, mode='title', pattern='contain')
Description
Catches all open pages that match the specified criteria.
Parameters
name<str> The title or URL to match.
mode<str> The page attribute to match.
Options:
title: Matches the page title.url: Matches the page URL.
pattern<str> The matching pattern.
Options:
equal: exact match.contain: substring match.regular: regular expression match.
Return Value
Returns a list of EdgeTab objects.<list>
Example- rpa.app.edge.catch_specific_pages-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled. At least one matching page must be open before using this method.
# Example:
page_list = rpa.app.edge.catch_specific_pages('Alibaba Cloud')catch_all_pages
catch_all_pages()
Description
Returns a list of EdgeTab objects for all open pages.
Example- rpa.app.edge.catch_all_pages-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# Example:
page_list = rpa.app.edge.catch_all_pages()catch_activated_pages
catch_activated_pages()
Description
Returns a list of EdgeTab objects for all active pages.
Example- rpa.app.edge.catch_activated_pages-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# When you have multiple Edge browser windows open, each with multiple tabs, this method returns the active page (tab) from each window.
# Example:
page_list = rpa.app.edge.catch_activated_pages()close_all
close_all(script_timeout=10)
Description
Closes all open Edge pages.
Parameters
script_timeout<float> The script execution timeout, in seconds. Defaults to 10.
Example- rpa.app.edge.close_all-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# Example:
rpa.app.edge.close_all(script_timeout=10)minimize
minimize()
Description
Minimizes the browser window.
Example- rpa.app.edge.minimize-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# If multiple Edge browser windows are open, this method minimizes only one of them.
# Example:
rpa.app.edge.minimize()restore
restore()
Description
Restores the browser window.
Example- rpa.app.edge.restore-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# If multiple Edge browser windows are open, this method restores only one of them.
# Example:
rpa.app.edge.restore()catch_from_element_name
catch_from_element_name(element)
Description
Catches a page using the name of an element it contains.
Parameters
element<str> The element name.
Return Value
Returns an EdgeTab object.
Example- rpa.app.edge.catch_from_element_name-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# Example:
page = rpa.app.edge.catch_from_element_name('Baidu Search Box')
page.input_text('Baidu Search Box', 'Alibaba Cloud')maximize
maximize()
Description
Maximizes the browser window.
Example- rpa.app.edge.maximize-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# If multiple Edge browser windows are open, this method maximizes only one of them.
# Example:
rpa.app.edge.maximize()get_cookies
get_cookies(url=None, domain=None, name=None)
Description
Retrieves a list of cookies.
Parameters
url<str> Filters for cookies that match the specified URL.
domain<str> Filters for cookies that match the specified domain or its subdomains.
name<str> Filters for cookies that match the specified name.
Return Value
Returns a list of matching cookies.<list>
Example- rpa.app.edge.get_cookies-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# The url parameter requires a full URL, including the protocol (e.g., https://).
# Example:
cookies = rpa.app.edge.get_cookies(url='https://www.aliyun.com')remove_cookie
remove_cookie(url, name)
Description
Deletes a cookie.
Parameters
url<str> The URL associated with the cookie.
name<str> The name of the cookie to delete.
Example- rpa.app.edge.remove_cookie-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# The url parameter requires a full URL, including the protocol (e.g., https://).
# 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)
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. Defaults to an empty string.
path<str> The path of the cookie. Defaults to the path portion of the url parameter.
secure<bool> Specifies whether to mark the cookie as secure.
http_only<bool> Specifies whether to mark the cookie as http_only.
expiration_date<str> The expiration date of the cookie.
Example- rpa.app.edge.set_cookie-
# Note: Ensure the Alibaba Cloud RPA extension for Edge is installed and enabled before using this method.
# The url parameter requires a full URL, including the protocol (e.g., https://).
# Example:
rpa.app.edge.set_cookie('https://www.baidu.com','rpa_test',value='Alibaba Cloud RPA Test_www.aliyun.com')