= Replace(iim1.iimGetLastExtract(), "[EXTRACT]", "")VBA prob

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

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.

= Replace(iim1.iimGetLastExtract(), "[EXTRACT]", "")VBA prob

by hoguz2 on Tue Nov 14, 2017 11:50 pm

Hi guys i have any problem could you some one help me please ...

i try some data extract.... if solve the problem i will use same loop in my code therefore i write only abbreviated sample from my code ...


Code: Select all
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=INPUT:SUBMİT FORM=NAME:sifreGirisForm ATTR=NAME:submitButton" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=A ATTR=TXT:Telefon<SP>No<SP>Sorgulama" + vbNewLine
MyMacroCode = MyMacroCode + "FRAME f = 2" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:ba CONTENT=xxxx" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:form1 ATTR=NAME:submit" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=TH ATTR=TXT:Birim<SP>Adı" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=R2 TYPE=TD ATTR=* EXTRACT=TXT" + vbNewLine
MyMacroCode = MyMacroCode + "SET !EXTRACTDIALOG YES" + vbNewLine
MyMacroCode = MyMacroCode + "PROMPT {{!EXTRACT}}" + vbNewLine

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'''''  ''"""""""""""""' yes i can  see  exctract  just here ... no problem..  when  PROMPT   dialog style """"""""""""
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


'"""""""""""""""""""""""""""""""""""""""""""""""""""
iret = iim1.iimset("TCNO", ws3.Cells(2, 2).Value)
iret = iim1.iimset("PASS", ws3.Cells(2, 3).Value)
ExtractedValue = Replace(iim1.iimGetLastExtract(), "[EXTRACT]", "")
iret = iim1.iimPlayCode(MyMacroCode)

MsgBox (ExtractedValue)

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'''''  ''"""""""""""""' there is problem msgbox value  get empty """"""""""""  i trry  Replace(iim1.iimGetLastExtract(1)   msgbox value  get NODATA value ..
'''' what is the wrong ....
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx



widows 8 64 bit
office 2010
imacros 10 brovser 10.02.2823
VERSION BUILD=10022823
mozilla firefox

thnx you so much
Mozilla : 53.0.2
iMacros Version : iMacros for Firefox 9.0.3
Win 8.1 64 bit
Ms_Office 2010 .TR
hoguz2
 
Posts: 12
Joined: Wed Apr 01, 2015 4:03 am
Location: TURKEY

Re: = Replace(iim1.iimGetLastExtract(), "[EXTRACT]", "")VBA

by chivracq on Wed Nov 15, 2017 10:06 am

hoguz2 wrote:Hi guys i have any problem could you some one help me please ...

i try some data extract.... if solve the problem i will use same loop in my code therefore i write only abbreviated sample from my code ...

Code: Select all
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=INPUT:SUBMİT FORM=NAME:sifreGirisForm ATTR=NAME:submitButton" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=A ATTR=TXT:Telefon<SP>No<SP>Sorgulama" + vbNewLine
MyMacroCode = MyMacroCode + "FRAME f = 2" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:ba CONTENT=xxxx" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=INPUT:BUTTON FORM=NAME:form1 ATTR=NAME:submit" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=1 TYPE=TH ATTR=TXT:Birim<SP>Adı" + vbNewLine
MyMacroCode = MyMacroCode + "TAG POS=R2 TYPE=TD ATTR=* EXTRACT=TXT" + vbNewLine
MyMacroCode = MyMacroCode + "SET !EXTRACTDIALOG YES" + vbNewLine
MyMacroCode = MyMacroCode + "PROMPT {{!EXTRACT}}" + vbNewLine

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'''''  ''"""""""""""""' yes i can  see  exctract  just here ... no problem..  when  PROMPT   dialog style """"""""""""
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


'"""""""""""""""""""""""""""""""""""""""""""""""""""
iret = iim1.iimset("TCNO", ws3.Cells(2, 2).Value)
iret = iim1.iimset("PASS", ws3.Cells(2, 3).Value)
ExtractedValue = Replace(iim1.iimGetLastExtract(), "[EXTRACT]", "")
iret = iim1.iimPlayCode(MyMacroCode)

MsgBox (ExtractedValue)

'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
'''''  ''"""""""""""""' there is problem msgbox value  get empty """"""""""""  i trry  Replace(iim1.iimGetLastExtract(1)   msgbox value  get NODATA value ..
'''' what is the wrong ....
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


Code: Select all
widows 8  64 bit
office  2010
imacros  10  brovser   10.02.2823
VERSION BUILD=10022823
mozilla firefox

Code: Select all
Mozilla : 53.0.2
iMacros Version : iMacros for Firefox 9.0.3
Win 8.1 64 bit
Ms_Office 2010 .TR


thnx you so much

Hum..., your Pb is VBA specific and not really specific to Data Extraction, your Thread would have been better I think in the 'Scripting Interface' Sub-Forum... But hum..., related to 'iimGet(Last)Extract()' though..., then I guess the 'Data Extraction' is alright as well... OK, never mind, ah-ah...!

OK, I don't do and don't know anything about VBS/VBA, but I have an Idea what is going wrong in your Script...
Your whole Script is a bit strange btw, you only do one 'EXTRACT', then you shouldn't have to care about removing any '[EXTRACT]' Separator in the '!EXTRACT'...
You do have an '!EXTRACTDIALOG' in your Script, but you don't have any 'ONDIALOG' or 'ONERRORDIALOG' Statement(s) afterwards, so I guess you don't get any Popup to extract as your Script would hang otherwise as those DialogBoxes are usually Tab or Browser Instance Modal...

But OK, what I think is wrong in your 'Replace()' Statement is that you try to use an iMacros Command inside it. The iMacros Scripting Interface knows about the VBS Compiler but the VBS Compiler or Runtime Engine doesn't know anything about iMacros, ah-ah...!
=> You first need to assign the Content of the 'iimGetLastExtract()' to a Var (= String) that you will then reuse inside the 'Replace()'...

Oh-oh-oh...!, maybe your Syntax is correct after all, as I notice stg "worse", you need to invoke the 'iimGetLastExtract()' Command AFTER running your Macro with 'iimPlayCode()', and not BEFORE like you currently do, ah-ah...! No wonder that '!EXTRACT' is empty then...! :shock:

And I'm not sure 'iimPlayCode()' was already implemented in iMB v10.02, but I guess you would get some explicit RuntimeError if it was not...

EDIT: Corrected a typo...: "Browser Instal" = "Browser Instance"...
Last edited by chivracq on Sat Nov 18, 2017 2:26 am, edited 1 time in total.
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6479
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: = Replace(iim1.iimGetLastExtract(), "[EXTRACT]", "")VBA

by hoguz2 on Fri Nov 17, 2017 4:47 am

Hi chivracq thanks.

I share a more detailed example. thnx..
Mozilla : 53.0.2
iMacros Version : iMacros for Firefox 9.0.3
Win 8.1 64 bit
Ms_Office 2010 .TR
hoguz2
 
Posts: 12
Joined: Wed Apr 01, 2015 4:03 am
Location: TURKEY


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: No registered users and 4 guests

-->