- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2024 03:49 AM
Hi All,
How to retrieve a value from HTML Table. I need to get the User Name.
Regards,
Siva
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 12:09 PM
Hello Guys @Ansh1 , @sivareddy ,
Apologizes for the late reply. I was stuck in someother work. Here we go. I just worked with your HTML and pasting the code below to print the User Name --> Creddy.
Cheers🥂.
var html = 'Your HTML Code';
var splitHtml = html.split('</td>');
var count = 0;
for (var i = 0; i < splitHtml.length; i++) {
if (splitHtml[i].includes('User Name')) {
count = i + 1;
}
}
var result = splitHtml[count].replace(/<[^>]*>/g, '').replace(' ', '').trim();
gs.info(result)
Regards,
Dhanraj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 05:36 AM
Hi @dhanrajb Please reply to the above thread
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 05:58 AM
We would like to Extract the 'User Name' that is 'creddy' here in the attached HTML. Request you to share the code for this.
Regards,
Ansh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2024 12:09 PM
Hello Guys @Ansh1 , @sivareddy ,
Apologizes for the late reply. I was stuck in someother work. Here we go. I just worked with your HTML and pasting the code below to print the User Name --> Creddy.
Cheers🥂.
var html = 'Your HTML Code';
var splitHtml = html.split('</td>');
var count = 0;
for (var i = 0; i < splitHtml.length; i++) {
if (splitHtml[i].includes('User Name')) {
count = i + 1;
}
}
var result = splitHtml[count].replace(/<[^>]*>/g, '').replace(' ', '').trim();
gs.info(result)
Regards,
Dhanraj.
