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.

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.

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

by xiaoyouzhang on Thu Jan 25, 2018 1: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?
xiaoyouzhang
 
Posts: 1
Joined: Thu Jan 25, 2018 1:04 am

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

by hoguz2 on Sat Jan 27, 2018 2: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
hoguz2
 
Posts: 15
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

-->