get text from html list

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

get text from html list

by ratatouille on Mon Feb 12, 2018 4:34 pm

i am using imacros to get the text of each list item. My html looks like..
Code: Select all
<html>
<div class="group">
<ul id="fruit_list">
   <li class="fruit">
      <a class="etiqueta">potato</a>
   </li>
   <li class="fruit">
      <a class="etiqueta">apple</a>
   </li>
   <li class="fruit">
      <a class="etiqueta">banana</a>
   </li>
   <li class="fruit">
      <a class="etiqueta">orange</a>
   </li>
</ul>
</div>
</html>


i tried with:
Code: Select all
TAG POS=1 TYPE=UL ATTR=ID:fruit_list EXTRACT=HTM
SET neat_list EVAL("var e_s = '{{!EXTRACT}}'; e_s.substring(e_s.indexOf('<li>'), e_s.lastIndexOf('<\\/li>')).replace(/(<li>|<\\/li>)/g, '').replace(/ +/g, ' ');")
PROMPT {{neat_list}}


I want to show my elements in this format:
Potato apple banana orange

But the result is:
<ul style="outline: 1px solid blue;" id="fruit_list"> <li class="order"> <a class="etiqueta">potato</a> </li> <li class="order"> <a class="etiqueta">apple</a> </li> <li class="order"> <a class="etiqueta">banana</a> </li> <li class="order"> <a class="etiqueta">orange</a> </li> </ul>


Can anyone explain how i can show correctly the elements?
ratatouille
 
Posts: 2
Joined: Mon Feb 12, 2018 4:18 pm

Return to General Support & Discussions

Who is online

Users browsing this forum: No registered users and 5 guests

-->