Question

How to get the HTML code from an HTML file.

  • 6 February 2024
  • 12 replies
  • 278 views

Badge +5

Hi all,

I want to get the HTML code from an HTML file and then use this code in the email body. I have used the capture activity but this approach does not work. The attached HTML files are for reference.


12 replies

Userlevel 5
Badge +9

Hi @tayyabimtiaz1 

 

Use Browser: Get source code from Actions Panel.

 

 

 

HTH

Regards

Userlevel 4
Badge +14

Rightly said @Raul Jaimes , Further @tayyabimtiaz1 can you let me know which HTML code you need to use in the email body.

Userlevel 2
Badge +5

Use following action to read the html file: Text file: Get text
Source file: Path to your HTML file

Output: String variable


You can then use this string variable inside email html body.
 

 

Badge +5

Rightly said @Raul Jaimes , Further @tayyabimtiaz1 can you let me know which HTML code you need to use in the email body.

I want to get the table from HTML and create that table in the email body. HTML files are attached earlier, and email body sample is also attached below.

 

 

Userlevel 4
Badge +14

Rightly said @Raul Jaimes , Further @tayyabimtiaz1 can you let me know which HTML code you need to use in the email body.

I want to get the table from HTML and create that table in the email body. HTML files are attached earlier, and email body sample is also attached below.

 

 

@tayyabimtiaz1, as I can see the the UBBE and Tracking number will be present in the portal itself right. So what you can do is extract the UBBE and Tracking number but before that create a static code of HTML till table tag and to insert the <td> tag you need to loop the UBBE and tracking number and then log it into the same static HTML code and further after creating the whole text file, get the text using Get text from file and then set the variable in Send Email. 

Further you can refer below link to get an in-depth understanding of creating dynamic HTML table.

https://www.youtube.com/watch?v=n6EJrGePoiE

Badge +5

Use following action to read the html file: Text file: Get text
Source file: Path to your HTML file

Output: String variable


You can then use this string variable inside email html body.
 

 

The input file is in HTML format and by using the get text action you can provide text files only.

Badge +5

Rightly said @Raul Jaimes , Further @tayyabimtiaz1 can you let me know which HTML code you need to use in the email body.

I want to get the table from HTML and create that table in the email body. HTML files are attached earlier, and email body sample is also attached below.

 

 

@tayyabimtiaz1, as I can see the the UBBE and Tracking number will be present in the portal itself right. So what you can do is extract the UBBE and Tracking number but before that create a static code of HTML till table tag and to insert the <td> tag you need to loop the UBBE and tracking number and then log it into the same static HTML code and further after creating the whole text file, get the text using Get text from file and then set the variable in Send Email. 

Further you can refer below link to get an in-depth understanding of creating dynamic HTML table.

https://www.youtube.com/watch?v=n6EJrGePoiE

The HTML file table has some data as well like some time 1 row 2 3 till n so thats why 

Userlevel 4
Badge +14

Rightly said @Raul Jaimes , Further @tayyabimtiaz1 can you let me know which HTML code you need to use in the email body.

I want to get the table from HTML and create that table in the email body. HTML files are attached earlier, and email body sample is also attached below.

 

 

@tayyabimtiaz1, as I can see the the UBBE and Tracking number will be present in the portal itself right. So what you can do is extract the UBBE and Tracking number but before that create a static code of HTML till table tag and to insert the <td> tag you need to loop the UBBE and tracking number and then log it into the same static HTML code and further after creating the whole text file, get the text using Get text from file and then set the variable in Send Email. 

Further you can refer below link to get an in-depth understanding of creating dynamic HTML table.

https://www.youtube.com/watch?v=n6EJrGePoiE

The HTML file table has some data as well like some time 1 row 2 3 till n so thats why 

Extract the data and set in a list, after that you can set in the static HTML table using above logic

Userlevel 2
Badge +5

Use following action to read the html file: Text file: Get text
Source file: Path to your HTML file

Output: String variable


You can then use this string variable inside email html body.
 

 

The input file is in HTML format and by using the get text action you can provide text files only.

@tayyabimtiaz1 Use copy option and create text file, use that text file to read data into string variable:
 

 

Userlevel 4
Badge +14

Use following action to read the html file: Text file: Get text
Source file: Path to your HTML file

Output: String variable


You can then use this string variable inside email html body.
 

 

The input file is in HTML format and by using the get text action you can provide text files only.

@tayyabimtiaz1 Use copy option create text file use that:
 

 

Yes you can this also.

Badge +5

But I am getting some extra data like serial number and NAN in empty cells. Below is the HTML CODE, no need of <th>0</th> and NAN. how i can remove or handle them

 

<table border="1" class="dataframe">
  <thead>
    <tr style="text-align: right;">
      <th></th>
      <th>UBBE Number</th>
      <th>Pickup Number</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>ub8698258298</td>
      <td>NaN</td>
    </tr>
  </tbody>
</table>

Userlevel 4
Badge +14

As the HTML files that you shared contains : UBBE Number and Pickup Number, So is the Pickup Number same as Tracking Number?

Reply