2

Is anyone know how to use get text & data scraping together and insert into Excel?

Picture

What I want to show in my Excel is those highlighted in Blue, i was able to get the datatable using Data Scraping but i cant get the “104445” together.

CK Ang
  • 111
  • 11
  • What did you already try out? Show us your process. Also have a look here on all the already asked questions and you will find a solution by your own. Your issue is not very special at all https://stackoverflow.com/questions/61572076/uipath-data-scraping-error-cannot-find-the-ui-element-corresponding-to-this-se – kwoxer Sep 01 '20 at 07:03

1 Answers1

1

What you have is a combination of tabular data in your PDF, and property-type data where the information comes in name-value pairs.

Is anyone know how to use get text & data scraping together and insert into Excel?

You've got the first part working. Now just add new activities to your process or workflow that will extract the text after the tabular data is extracted. Hold the specific data fields in variables, and then just use the Excel activities to write the DataTable and information held in variables into the spreadsheet. Append Range and Write Cell Excel activities will likely do the trick.

Table data vs name-value pairs

The UiPath data scraping functions are perfect for the tabular data. As you have discovered, it brings everything back as a DataTable. The individual pieces of data require more fine grained data extraction.

For the 104445, you will need to use the get Text function, in combination with the Anchor Base function.

  • You add the Anchor Base function onto the page. The Anchor Base requires two activities to be added in order for it to work.
  • The first activity is a get Element. This will specify the label to the left of 104445.
  • Then you add a get Textactivity to retrieve the text next to the get Element activity. This will extract the 104445.
  • You then hold the result in a String variable and use it as you like.

Anchor Base Activity Example

In the following UiPath Anchor Base example, the label is above the text I want to extract so the Anchor Base activity sets the anchor location to be above the text to extract. In your example, you would set the UiPath Anchor Base activity to indicate that the anchor is to the left of the text to extract.

enter image description here

By the way, you can use the PDF get Text activity alone without the Anchor Base activity, but it likely won't work if you need to extract data from multiple PDFs, as the UiPath selector will be too specific. If you need to loop through multiple PDF files, you'll want to use the Anchor Base activity.

Tagged PDFs only

Just a note to anyone else looking at this answer. For the data scraping and get text activities to work, the PDF must be tagged. If the properties indicate that PDF is not tagged, these features will not always work as advertised. Furthermore, if the PDF is really just a scanned image, you will need to use UiPath OCR facilities. The data scraping and get text activities won't work at all.

Also, in order to get the data scraping or get text activities to work propertly, you many need to change the reading order property of the Adobe or FoxIt reader to infer or tagged.

enter image description here

Cameron McKenzie
  • 3,684
  • 32
  • 28