Loop/Changing Page

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
inoob
Posts: 1
Joined: Fri Jun 15, 2018 12:49 pm

Loop/Changing Page

Post by inoob » Fri Jun 15, 2018 1:24 pm

Version Build=9030808
FireFox =51.0.1

Hello here is what I have done so far, I took out the url because you guys can not get to it anyway. So I will explain, it is a database that shows all our products, pictures of them, names and so forth. I need to copy and extract just the names of them to a csv file. Did that and it is done, everything below works just fine. So when I go to the site, it will loop and extract all the names on that page (extracting 100 names per page), my issue we have 934 pages we need to do this to, so how can I create it where I can extract the names I need on that page and once it extracts the last name on the page it will go ahead and hit next page. I was trying to use !loop but I may have to manually select them all and then just have it hit the next page then !loop. But I am curious is there a way where I can run loop and then have it hit the next page and then have it start over again on the extraction? Thanks and sorry if this is a bit confusing I am new to imacro as well.

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
'URL GOTO=http
Wait Seconds=.5
'TAG POS=1 TYPE=SPAN ATTR=id:el1_Picture_Model EXTRACT=TXT
TAG POS={{!LOOP}} TYPE=SPAN ATTR=id:*Picture_Model EXTRACT=TXT
'TAG POS=1 TYPE=SPAN ATTR=CLASS:icon-next<SP>ewIcon&&TXT:
Wait Seconds=.5
SAVEAS TYPE=EXTRACT FOLDER=C:\ FILE=extractions.csv
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Loop/Changing Page

Post by chivracq » Fri Jun 15, 2018 2:33 pm

inoob wrote:

Code: Select all

Version Build=9030808
FireFox =51.0.1
Hello here is what I have done so far, I took out the url because you guys can not get to it anyway. So I will explain, it is a database that shows all our products, pictures of them, names and so forth. I need to copy and extract just the names of them to a csv file. Did that and it is done, everything below works just fine. So when I go to the site, it will loop and extract all the names on that page (extracting 100 names per page), my issue we have 934 pages we need to do this to, so how can I create it where I can extract the names I need on that page and once it extracts the last name on the page it will go ahead and hit next page. I was trying to use !loop but I may have to manually select them all and then just have it hit the next page then !loop. But I am curious is there a way where I can run loop and then have it hit the next page and then have it start over again on the extraction? Thanks and sorry if this is a bit confusing I am new to imacro as well.

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
'URL GOTO=http
Wait Seconds=.5
'TAG POS=1 TYPE=SPAN ATTR=id:el1_Picture_Model EXTRACT=TXT
TAG POS={{!LOOP}} TYPE=SPAN ATTR=id:*Picture_Model EXTRACT=TXT
'TAG POS=1 TYPE=SPAN ATTR=CLASS:icon-next<SP>ewIcon&&TXT:
Wait Seconds=.5
SAVEAS TYPE=EXTRACT FOLDER=C:\ FILE=extractions.csv
Yep, you are on the "good track", ah-ah...! 8)

Now, search the Forum using the following Search Keywords "nested + loop(s) + eval + modulo" and you should find a few Examples of what you need next... :idea:

The "Principle" is using 'EVAL()' to compute a Var based on '!LOOP' that will start looping again from 1-2-3-... at 101-102-103-..., and that will "spit" a "1" to use for 'TAG POS=n' on your 'Next' Button only for '!LOOP'=100-200-300-... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Post Reply