How Extract Data in .NET Component

Discussions and Tech Support related to using the iMacros Component for .NET in your applications.
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.
Post Reply
chiaravel
Posts: 9
Joined: Mon Sep 08, 2014 6:12 pm

How Extract Data in .NET Component

Post by chiaravel » Tue Sep 23, 2014 3:36 am

Hi,

I have this code into a Sub.

Code: Select all

        Try
            im = iMacrosControl.Create(My.Settings.LicenciaIMACROS)

            t = "CODE: CLEAR"
            im.Play(t)

            t = "CODE: URL GOTO=https://accounts.google.com/ServiceLogin?service=adsense&rm=hide&nui=15&alwf=true&ltmpl=adsense&passive=false&continue=https://www.google.com/adsense/gaiaauth2?hl%3Des%26subid%3Dww-es-et-nelson_adsense&followup=https://www.google.com/adsense/gaiaauth2?hl%3Des%26subid%3Dww-es-et-nelson_adsense%26sourceid%3Daso&hl=es"
            im.Play(t)

            t = "CODE: TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:https://accounts.google.com/ServiceLoginAuth ATTR=NAME:Email CONTENT=xxxxxx@xxxxxxxx.com"
            im.Play(t)

            t = "CODE: SET !ENCRYPTION NO"
            im.Play(t)

            t = "CODE: TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:https://accounts.google.com/ServiceLoginAuth ATTR=NAME:Passwd CONTENT=xxxxxxxx"
            im.Play(t)

            t = "CODE: TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:https://accounts.google.com/ServiceLoginAuth ATTR=NAME:signIn"
            im.Play(t)

            t = "CODE: TAG POS=1 TYPE=DIV ATTR=CLASS:earnings-value EXTRACT=TXT"
            im.Play(t)

            t = "CODE: TAG POS=2 TYPE=DIV ATTR=CLASS:earnings-value EXTRACT=TXT"
            im.Play(t)

            t = "CODE: TAG POS=3 TYPE=DIV ATTR=CLASS:earnings-value EXTRACT=TXT"
            im.Play(t)

            t = "CODE: TAG POS=4 TYPE=DIV ATTR=CLASS:earnings-value EXTRACT=TXT"
            im.Play(t)

            Dim extract = String.Empty

            If im.ExtractedValues.Count > 0 Then
                extract = String.Join("[sep]", im.ExtractedValues.ToArray())
            End If

        Catch ex As Exception
            MsgBox(Err.Number.ToString + " " + Err.Description)
        End Try
But im.ExtractedValues.Count throw 0

What's Wrong ?

Thanks in advance
joshi2014
Posts: 3
Joined: Wed Oct 22, 2014 7:15 am

Re: How Extract Data in .NET Component

Post by joshi2014 » Wed Oct 22, 2014 8:07 am

Hi. I have an idea about it...

You using after every line of script the iim.play command, but You need to play a complete Macro once.

Solution:

Code: Select all

Dim MyMacro as String = "CODE clear" & vbNewline
MyMacro &= "SET! blabla" & vbNewline
MyMacro &= "URL blabla" & vbNewline
im.Play(MyMacro)
I just pointed out to make first the Macro String the Syntax is not right... but maybe that helps.

c.u. joshi
chiaravel
Posts: 9
Joined: Mon Sep 08, 2014 6:12 pm

Re: How Extract Data in .NET Component

Post by chiaravel » Sun Nov 02, 2014 11:49 pm

Thanks Joshi

sorry for the delay..

But How can I take the control if I need to play all together ?

I need to check after every extract if the data is loaded..

this allow to us to make loop structures until data is extracted right.

I have a lot of problems running once..

I put a lot of seconds in TIMEOUT variables to run fine.. and a lot of times, the Imacros Component fail.

Are too much Flash sites, or intelligent platforms that user Ajax for give the info.

IMACROS haven't IF or WHILE statemens..

What can I do ?

Regards
kritikas
Posts: 5
Joined: Mon Jan 14, 2019 10:11 am

Re: How Extract Data in .NET Component

Post by kritikas » Sat Jan 19, 2019 6:08 am

To extract a complete web page (or the complete header or body) you need to manually in .Net insert the appropriate TAG line. Please see the example:

URL GOTO=URL
'Complete Page
TAG POS=1 TYPE=HTML ATTR=* EXTRACT=HTM
'Complete Page TEXT only
TAG POS=1 TYPE=HTML ATTR=* EXTRACT=TXT
'Page header only
TAG POS=1 TYPE=HEAD ATTR=* EXTRACT=HTM
'Page body
TAG POS=1 TYPE=BODY ATTR=* EXTRACT=HTM
Dot Net Programming
Post Reply