Negative Relative Extraction Problem

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
sventhebrit
Posts: 3
Joined: Tue May 13, 2008 5:42 pm

Negative Relative Extraction Problem

Post by sventhebrit » Mon Jul 28, 2008 9:13 pm

Hi All,
A total Newbie to iMacros and looking for some help from a more experienced user.

I have a problem with the negative relative extraction on eBay.com

Windows XP SP2
iMacros v6.2
Office 2003 - Using Excel VBA to control the iMacros Browser

I was trying to extract data from the ebay.com website. The listings are in batches of 50. I can extract the first 49 items and then it fails on the 50th. I have tried displaying 100 auctions to a page and it extracts the first 99 items and fails on the 100th - - the 50th items extracts OK in this instance. I have looked at the source of the eBay page and can see no difference in the formatting of the last item on each page.

To replicate, goto http://www.ebay.com and search for 'toner' (for example) -- at the time of writing there are 24,000+ items for 'toner' split over multiple pages. I have created a sample macro which demonstrates the problem. It extracts items 1, 2, 49, and 50 (note: In my VBA code, I use a loop and pass a variable called Pos to iMacro, change the page and then repeat the process). The logic I use is to find the time left on the page and then using negative relative positioning to extract the link which conforms to the following syntax - http://cgi.ebay.com/*.

Once you have navigated to the search results, run the simple macro below from within the browser.

Code: Select all

TAG POS=1 TYPE=SPAN ATTR=CLASS:time*
TAG POS=R-1 TYPE=A ATTR=TXT:*&&HREF:http://cgi.ebay.com/* EXTRACT=HREF
TAG POS=2 TYPE=SPAN ATTR=CLASS:time*
TAG POS=R-1 TYPE=A ATTR=TXT:*&&HREF:http://cgi.ebay.com/* EXTRACT=HREF
TAG POS=49 TYPE=SPAN ATTR=CLASS:time*
TAG POS=R-1 TYPE=A ATTR=TXT:*&&HREF:http://cgi.ebay.com/* EXTRACT=HREF
TAG POS=50 TYPE=SPAN ATTR=CLASS:time*
TAG POS=R-1 TYPE=A ATTR=TXT:*&&HREF:http://cgi.ebay.com/* EXTRACT=HREF
The first 3 items - 1,2 and 49 extract correctly. The last item - 50th - fails with #EANF#.

Any suggestions. I doubt it is a bug with iMacros, but any pointers on my code to do the extract would be appreciated.

Cheers
Steve :mrgreen:
Renius
Posts: 5
Joined: Tue Jul 29, 2008 3:34 am

Re: Negative Relative Extraction Problem

Post by Renius » Tue Jul 29, 2008 3:47 am

RuntimeError: element SPAN specified by CLASS:time* was not found, macro line 4
this is the first line of your code
sventhebrit
Posts: 3
Joined: Tue May 13, 2008 5:42 pm

Re: Negative Relative Extraction Problem

Post by sventhebrit » Tue Jul 29, 2008 8:53 am

Hi there,

Not sure why you get the error when running the Macro.
I have added an extra line to the Macro which opens up a sample eBay webpage. If you cut and paste the code below into a new iMacro (iim File), open up the IMacros broswer and run the new macro.

It will extract items 1,2 and 49 OK and then fail on the 50th.

Thanks for your interest in my problem.
Steve

Code: Select all

URL GOTO=http://shop.ebay.com/?_from=R40&_trksid=m38&_nkw=toner&_sacat=See-All-Categories
TAG POS=1 TYPE=SPAN ATTR=CLASS:time*
TAG POS=R-1 TYPE=A ATTR=TXT:*&&HREF:http://cgi.ebay.com/* EXTRACT=HREF
TAG POS=2 TYPE=SPAN ATTR=CLASS:time*
TAG POS=R-1 TYPE=A ATTR=TXT:*&&HREF:http://cgi.ebay.com/* EXTRACT=HREF
TAG POS=49 TYPE=SPAN ATTR=CLASS:time*
TAG POS=R-1 TYPE=A ATTR=TXT:*&&HREF:http://cgi.ebay.com/* EXTRACT=HREF
TAG POS=50 TYPE=SPAN ATTR=CLASS:time*
TAG POS=R-1 TYPE=A ATTR=TXT:*&&HREF:http://cgi.ebay.com/* EXTRACT=HREF
UKiMacrosUser
Posts: 6
Joined: Wed Feb 20, 2008 5:06 pm

Re: Negative Relative Extraction Problem

Post by UKiMacrosUser » Mon Sep 08, 2008 9:11 am

Hi,

I am having exactly the same problem, though I only have 11 checkboxes to select.

Negative relative positioning works for the first 10 boxes but cannot find the 11th and last box... iMacro code below:

SET !TIMEOUT 300
TAB T=1
TAB CLOSEALLOTHERS
TAG POS=1 TYPE=HR
TAG POS=1 TYPE=TD ATTR=TXT:request<SP>returned<SP>no<SP>data*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=2 TYPE=TD ATTR=TXT:request<SP>returned<SP>no<SP>data*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=1 TYPE=TD ATTR=TXT:58558G20080822*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=1 TYPE=TD ATTR=TXT:58558D20080822*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=3 TYPE=TD ATTR=TXT:request<SP>returned<SP>no<SP>data*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=4 TYPE=TD ATTR=TXT:request<SP>returned<SP>no<SP>data*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=1 TYPE=TD ATTR=TXT:54294G20080822*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=1 TYPE=TD ATTR=TXT:54294D20080822*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=1 TYPE=TD ATTR=TXT:31023K20080822*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=1 TYPE=TD ATTR=TXT:31023H20080822*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES
TAG POS=1 TYPE=TD ATTR=TXT:31023G20080822*
TAG POS=R-1 TYPE=INPUT:CHECKBOX FORM=NAME:* ATTR=NAME:* CONTENT=YES

The last line fails. The TD with text attribute 31023G20080822 is definitely found because it is highlighted in blue, and if I change the last line to find the TABLE CELL (TD) at position R-1 this is also found as it is highlighted in blue - however, even though the web page html is exactly the same for all rows of this table, iMacros cannot locate the last checkbox.

Please help!
Fidibus
Posts: 6
Joined: Thu Mar 12, 2009 1:30 pm

Re: Negative Relative Extraction Problem

Post by Fidibus » Thu Mar 12, 2009 1:39 pm

Hi,
I just wanted to check whether there is some thread that answers the problem with negative relative positioning at the end of pages.
I also extract data from a table and relative negative positioning works perfectly well until the last element (i.e., 50++ times) where suddenly an error "-317" occurs (which I couldn't see in your error code description) that tells me "Element empty" and then the simulation stops.
It is exactly the same problem as my pre-posters had. Any idea of how to resolve this?

Cheers, Konrad
BrianR
Posts: 126
Joined: Wed Jun 11, 2008 4:13 pm

Re: Negative Relative Extraction Problem

Post by BrianR » Thu Mar 12, 2009 4:23 pm

I have placed this in some of my Macros to ignore an error.

Code: Select all

SET !LOADCHECK NO

' ==============================================================
' Loadcheck is turned off so an error would not occur if 
' an input tag is not found.   ( May only have 3 rows not 10 )
' ==============================================================
Hijotech
Posts: 14
Joined: Tue Sep 26, 2017 5:54 pm

Re: Negative Relative Extraction Problem

Post by Hijotech » Tue Oct 10, 2017 1:59 am

BrianR wrote:I have placed this in some of my Macros to ignore an error.

Code: Select all

SET !LOADCHECK NO

' ==============================================================
' Loadcheck is turned off so an error would not occur if 
' an input tag is not found.   ( May only have 3 rows not 10 )
' ==============================================================
Google Chrome:61.0.3163.100
Os: Windows 7 x64
iMacros: 8.4.4

Hi,

I will like iMacros to bid a price of product online automatically by quary data from excel base on the shoe size such as the following: For Example

I have created list of shoes product and their cost base on sizes excel:

Dorothy's Ruby Red Shoes size
1. 206 --------- $35
2. 207 --------- $40
3. 507 --------- $48
4. 701 -------- $56
5. 800 -------- $80
6. 805 --------- $95

Now if iMacros click on the Shoe size, I want iMacros to automatically quary the excel data to locate the exact bid price of the shoe i specified in the excel file and input it into the price box on the web.
TAG POS=1 TYPE=INPUT:NUMBER ATTR=ID:inputPrice CONTENT="*"
If the iMacros select the Dorothy's Ruby Red Shoes size that are not on the excel file iMacros should skip to the next line of code which is:
Wait Seconds:840
Please Help
Post Reply