[HELP] How to pick up only the numbers of a code?

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

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:


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.

[HELP] How to pick up only the numbers of a code?

by raphael.mca on Sun Apr 03, 2016 7:32 pm

Friends , I would like first to congratulate this community and say that I am very excited about the iMacros .
As I mentioned in my thread , I am new to programming and I'm still learning to do many functions.
If someone can give me a little help with a particular function I thank you.
This is the next I had a code in my imacro ( java ) he took a certain value that was displayed on a web page ..

Like this...
Page code
Code: Select all
<span id="trac-oue-pt" class="grd-grid-12 grd-with-top-pang stin">9.87</span>

Script code iMacro
Code: Select all
macro+= "TAG POS=1 TYPE=SPAN ATTR=CLASS:grd-grid-12<SP>grd-with-top-pang<SP>stin&&ID:trac-oue-pt EXTRACT=TXT\n";

However, the web page has been updated and now with the number is also displayed a text , and I need to be extracted only the numbers that text , as was done in the previous version .

Currently this so ...
Page code
Code: Select all
<div class="col" id="cotrc_ps_put">Here now<p>9.87</p></div>

Script code iMacro
Code: Select all

There is the possibility to do what I want ?
Thank you and God bless .
Posts: 3
Joined: Sat Apr 02, 2016 5:25 pm

Re: [HELP] How to pick up only the numbers of a code?

by Tom, Tech Support on Thu Apr 14, 2016 7:40 am

Hi raphael.mca,

Yes, you can use the EVAL command in your macro to further parse extracted data. See the reference page for examples.

Tom, iMacros Support
Tom, Tech Support
Posts: 3303
Joined: Mon May 31, 2010 9:59 am

Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 3 guests