How To Convert HTML to Text

Hi Team, I have HTML code so how to see the output of HTML code.
Please find the below attachment of HTML code

So how will see the output of this HTML code in UiPath

1 Like

I think the UiPath forum setup converted your html code into the user interface output (the output that you are searching for :joy:)

To see the output of any html code , type the html code in a notepad file and save it as “.txt” file
Then rename this “.txt” file to “.html”
Now you can open this html file in any web browser to see the html parsed output

I hope this helps :smiling_face:

Hi

Hope the below steps would help you resolve this

  1. Save this in a notepad with file extension as .html

  2. Now use open browser or use browser activity where pass the filepath of the html file and choose the browser
    It will open that html file in that browser for display

Hope this helps

Cheers @Kaviya_V

Oh ok now I see the updated image in your question
Add the following text at starting of your html code: (angular bracket start)html(angular bracket close)
And at end :
(angular bracket start)/html(angular bracket close)
And then save, rename txt file to .html and open using web browser

Starting:

<html>

At end add:

</html>

First of all thank u for your following answer. Actually, my requirement is, In excel file have Two Columns, Within two column any of the cell contains the html code, so i have to check which cell contains the html code then write the output of HTML code in Same Cell, this is my requirement. so will i handle this in UiPath by using activity.

1 Like

Hi @Kaviya_V ,
Can you share your expect output?
I think you can get by regex
regards,

@Kaviya_V

  1. Read the cell…
  2. Save the string as text file .html using write text file
  3. Use Open browser and use get text activity and get full text from full page
  4. Use the write cell to write the extracted data

cheers

Hope the below steps steps would help you resolve this

  1. Use the “Excel Application Scope” activity to open and read the Excel file.

  2. Use the “Read Range” activity to read the data into a DataTable named dt

  3. Use a “For Each Row” activity to iterate through each row of the DataTable.

  4. Inside the “For Each Row” loop, use an “If” activity to check if either of the two columns contains HTML code. You can use regular expressions or other string manipulation methods to identify HTML code within a cell.
    Simply use a IF activity and see whether the

CurrentRow(“columnname”).ToString.ToUpper.Contains(“<HTML>”) OR CurrentRow(“columnname”).ToString.ToUpper.Contains(“</HTML>”)

If true it goes to then block or Else block

  1. In then to Write it in a text file use WRITE TEXT FILE activity and save the file with file extension .html

  2. Then use Use Browser/Application activity or open browser activity and pass the above text .html file path

  3. This will open the html and give the output. Get that with a GET TEXT activity and save it to a variable named Strinput

  4. To write back to the datatable use a assign activity like this

CurrentRow(“columnname”) = strinput.ToString

  1. Outside to this for each row loop use a WRITE RANGE activity and pass dt as input and enable add headers and pass the file path of excel file

Cheers @saurabhB

Thanks @Palaniyappan and @Anil. I will check and update You

2 Likes