Extracting info until certain element is no longer on site

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.

Extracting info until certain element is no longer on site

by OniLinken on Sun Nov 13, 2016 10:42 pm

Hi. First of all:
Win 10, 64bits, iMacros v11.1.149/Firefox 47 iMacros for FF v9.0.3
In second place, thanks in advance for helping me.

I'm extracting information form a site... with several pages.
I managed to find a way to extract info from the page but, if I need to get to the next page to keep extracting info, I need the macros to "click" the next button.
In the site, there's a '>' symbol that represents the "next page"...

So, I need to do some imacros steps until I can't find the '>' symbol in the site, on several pages.

This code makes the macros to "turn the page": TAG POS=1 TYPE=LI ATTR=TXT:>

Is there a way I can make like a while?

while('>' symbol exist){
several extraction steps and code
TAG POS=1 TYPE=LI ATTR=TXT:> (the "next" click so I can continue the extraction in the next page)
}

Sorry the long post. Thanks in advance.
OniLinken
 
Posts: 6
Joined: Sun Nov 06, 2016 10:04 am

Re: Extracting info until certain element is no longer on si

by chivracq on Mon Nov 14, 2016 8:54 am

OniLinken wrote:Hi. First of all:
Code: Select all
Win 10, 64bits, iMacros v11.1.149/Firefox 47 iMacros for FF v9.0.3

In second place, thanks in advance for helping me.

I'm extracting information form a site... with several pages.
I managed to find a way to extract info from the page but, if I need to get to the next page to keep extracting info, I need the macros to "click" the next button.
In the site, there's a '>' symbol that represents the "next page"...

So, I need to do some imacros steps until I can't find the '>' symbol in the site, on several pages.

This code makes the macros to "turn the page":
Code: Select all
TAG POS=1 TYPE=LI ATTR=TXT:>


Is there a way I can make like a while?

while('>' symbol exist){
several extraction steps and code
TAG POS=1 TYPE=LI ATTR=TXT:> (the "next" click so I can continue the extraction in the next page)
}

Sorry the long post. Thanks in advance.

What is wrong with simply including that Statement at the End of your Script (I guess you loop it per Page you extract) and your Script will automatically stop once it is not found anymore...? (with '!ERRORIGNORE'=NO of course.)
- (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: 6390
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Extracting info until certain element is no longer on si

by OniLinken on Mon Nov 28, 2016 6:15 pm

Hi! Sorry it took me this long to reply... I got very sick and ended up in the hospital for several days.

I took your advice but my guess is that i'm not using it right.
I thought it should look like this


Code: Select all
<several tasks>
TAG POS=1 TYPE=LI ATTR=TXT:>
SET !ERRORIGNORE NO

the iMacros does change to the next page, but it doesn't repeat the first several tasks
But to be honest, i've never used !ERRORIGNORE and I dont know how to.

Can you help me this last time, please?
Cheers.

EDIT: Just realized iMacros have a loop option and used in my advantage... thanks for everything
OniLinken
 
Posts: 6
Joined: Sun Nov 06, 2016 10:04 am

Re: Extracting info until certain element is no longer on si

by chivracq on Mon Nov 28, 2016 9:08 pm

OniLinken wrote:Hi! Sorry it took me this long to reply... I got very sick and ended up in the hospital for several days.

I took your advice but my guess is that i'm not using it right.
I thought it should look like this
Code: Select all
<several tasks>
TAG POS=1 TYPE=LI ATTR=TXT:>
SET !ERRORIGNORE NO

the iMacros does change to the next page, but it doesn't repeat the first several tasks
But to be honest, i've never used !ERRORIGNORE and I dont know how to.

Can you help me this last time, please?
Cheers.

EDIT: Just realized iMacros have a loop option and used in my advantage... thanks for everything

Sorry to hear about your "bad" last 2 weeks, no Pb of course that you couldn't follow up quicker...

OK, good to hear that you "discovered" the Loop Functionality, ah-ah...!, and that it indeed solves your Pb...

Mini-Remark: I was mentioning '!ERRORIGNORE' in case you were using it, the Default is already "NO"... (and you would need to place it BEFORE and not AFTER your Statement to click on the 'Next' Button.)

The "best" place to have a look at all Functionality available in iMacros is the Command Reference in the Wiki... :idea:
(And dare to ask and to open new Threads if you encounter any new Pb's or have some more Qt's, that's the "Purpose" of the Forum, ah-ah...!, and searching the Forum or reading a few Forum Pages is a great Resource as well...)
- (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: 6390
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: Google [Bot] and 2 guests

-->