I want to extract information from the site but it's dynamic

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
xiaoyouzhang
Posts: 1
Joined: Thu Jan 25, 2018 8:04 am

I want to extract information from the site but it's dynamic

Post by xiaoyouzhang » Thu Jan 25, 2018 8:54 am

454/5000
I come from China. The English language is very poor, which is translated by translation software. I'm learning imacros now, and I have a problem.
Q: How do I extract information from a table with variable length and/or more than one page?
I can't understand.
I want to extract information from the site but it's dynamic. My code looks like this.
Macro =macro+"TAG POS={XX} TYPY=TD ATTR=*EXTRACT=TXT"+.
vbNewLine
XX is changed. How can I get the value of XX?
Once you get the #EANF# message back instead of a result you know that you reached the end of the table on the current page.
I don't understand that I don't know how to write code can I give you a simple example?
hoguz2
Posts: 15
Joined: Wed Apr 01, 2015 11:03 am
Location: TURKEY

Re: I want to extract information from the site but it's dyn

Post by hoguz2 » Sat Jan 27, 2018 9:24 am

Hi China , " 嗨 " , From Turkey

I think you want to use VBS script for LOOP

there are many examples http://wiki.imacros.net/VBS_looping you should see..
a study of a sample and write my code for my procejt

Code: Select all

Option Explicit
Dim iim1,iret
Set iim1 = CreateObject("iMacros")
iret = iim1.iimOpen("", False) 

Dim macro 

macro = macro & "VERSION BUILD=6110122 " & vbNewLine
macro = macro & "TAB T=1" & vbNewLine
macro = macro & "TAB CLOSEALLOTHERS" & vbNewLine
macro = macro & "SET !TIMEOUT 6" & vbNewLine
macro = macro & "SET !VAR1 3" & vbNewLine
macro = macro & "TAG POS={{counter}} TYPE=DIV ATTR=TXT:{{protean}}<SP>Point<SP>+<SP>1<SP>Ticket" & vbNewLine
macro = macro & "WAIT SECONDS={{!VAR1}}" & vbNewLine
macro = macro & "TAB T=2" & vbNewLine
macro = macro & "WAIT SECONDS={{wait_time}}" & vbNewLine
macro = macro & "TAB T=1" & vbNewLine
macro = macro & "TAB CLOSEALLOTHERS" & vbNewLine



Dim counter , protean ,wait_time
counter = 1
protean = 10
wait_time = protean + 10
Do While Not (iret < 0)
iim1.iimSet "counter", counter
iim1.iimSet "protean", protean
iim1.iimSet "wait_time", wait_time
iret = iim1.iimPlayCode(macro)
counter = counter + 1      

If (iret < 0)  AND protean =  10 Then

counter = 1
protean = 30
wait_time = protean + 10
Do While Not (iret < 0)
iim1.iimSet "counter", counter
iim1.iimSet "protean", protean
iim1.iimSet "wait_time", wait_time
iret = iim1.iimPlayCode(macro)
counter = counter + 1   

If (iret < 0)  AND protean = 30 Then
Wscript.Quit    

End If
Loop
End If
Loop
Mozilla : 53.0.2
iMacros Version : iMacros for Firefox 9.0.3
Win 8.1 64 bit
Ms_Office 2010 .TR
Post Reply