UiPath Documentation
activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

用户界面自动化活动

上次更新日期 2026年5月14日

GetText

从用户界面元素中提取并复制文本。

必须在“打开”“附加”之后添加此 API。

定义

命名空间:UiPath.UIAutomationNext.API.Models

程序集:UiPath.UIAutomationNext.API.Models(位于 UiPath.UIAutomationNext.API.Models dll 中)

重载

重载描述
GetText(String)从用户界面元素中提取并复制文本(标识为字符串)。
GetText(String, GetTextOptions)在自定义提取 Actions时,从用户界面元素中提取并复制文本(标识为字符串)。
GetText(TargetAnchorableModel, GetTextOptions)在自定义提取 Actions时,从标识为 Target Anchorable Model 对象的用户界面元素中提取并复制文本。

GetText(String)

从用户界面元素中提取并复制文本(标识为字符串)。

GetText(
    string target)
GetText(
    string target)

target String :指示在对象存储库中捕获的您要提取的用户界面元素。

GetText(String, GetTextOptions)

在自定义提取 Actions时,从用户界面元素中提取并复制文本(标识为字符串)。

GetText(
    string target, 
    GetTextOptions getTextOptions)
GetText(
    string target, 
    GetTextOptions getTextOptions)

target String :指示在对象存储库中捕获的您要提取的用户界面元素。

getTextOptions GetTextOptions :用于自定义文本提取过程的其他选项。您可以选择自定义以下项目:

* `ScrapingOptions
  NScrapingOptions`:
  + `Default`
  + `TextAttribute`
  + `Native` (enables you to **Allow
    formatting** and retrieve the screen coordinates of
    the words)
  + `FullText` (offers the option to
    **Ignore hidden text**)
* `ScrapingAPI NScrapingAPI`
  + `None`
  + `AllowFormatting`
  + `IgnoreHiddenText`
  + `GetWordCoordinates`
* `ScrapingOptions
  NScrapingOptions`:
  + `Default`
  + `TextAttribute`
  + `Native` (enables you to **Allow
    formatting** and retrieve the screen coordinates of
    the words)
  + `FullText` (offers the option to
    **Ignore hidden text**)
* `ScrapingAPI NScrapingAPI`
  + `None`
  + `AllowFormatting`
  + `IgnoreHiddenText`
  + `GetWordCoordinates`

GetText(TargetAnchorableModel, GetTextOptions)

在自定义提取 Actions时,从标识为 Target Anchorable Model 对象的用户界面元素中提取并复制文本。

GetText(
    TargetAnchorableModel target, 
    GetTextOptions getTextOptions)
GetText(
    TargetAnchorableModel target, 
    GetTextOptions getTextOptions)

TargetAnchorableModel TargetAnchorableModel :指明要提取的标识为TargetAnchorableModel用户界面元素。

getTextOptions GetTextOptions :用于自定义文本提取过程的其他选项。您可以选择自定义以下项目:

* `ScrapingOptions
  NScrapingOptions`:
  + `Default`
  + `TextAttribute`
  + `Native` (enables you to **Allow
    formatting** and retrieve the screen coordinates of
    the words)
  + `FullText` (offers the option to
    **Ignore hidden text**)
* `ScrapingAPI NScrapingAPI`
  + `None`
  + `AllowFormatting`
  + `IgnoreHiddenText`
  + `GetWordCoordinates`
* `ScrapingOptions
  NScrapingOptions`:
  + `Default`
  + `TextAttribute`
  + `Native` (enables you to **Allow
    formatting** and retrieve the screen coordinates of
    the words)
  + `FullText` (offers the option to
    **Ignore hidden text**)
* `ScrapingAPI NScrapingAPI`
  + `None`
  + `AllowFormatting`
  + `IgnoreHiddenText`
  + `GetWordCoordinates`

返回值

指定用户界面元素中的文本。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新