extract dynamical prices

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
RomaneRomy
Posts: 6
Joined: Mon Jul 02, 2018 10:19 am

extract dynamical prices

Post by RomaneRomy » Fri Jul 06, 2018 7:34 am

Windows10/
iMacros v12 enterprise edition/

Good morning,
I've been searching for so long, and I found answers on the forum, but it doesn't work for my case...I hope someone could help me.
I need to extract products transport cost on a website (such as amazon), but it depends on the number of products ordered.
When I create my macro on iMacros, I just underline the price with my mouse : TAG POS=1 TYPE=P ATTR=TXT:5,76<SP>€
But if I run my macro again and that this price changed, it still indicate 5.76 euros.
My question : how to extract in a better way dynamic informations ? Then I want this information in a csv.
template of my extraction :
TAG POS=1 TYPE=P ATTR=TXT:5,76<SP>€ EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\UTILISATEUR\Documents\iMacros FILE=TSEfraisTransport1.csv

Best regards, Romane (from France)
RomaneRomy
Posts: 6
Joined: Mon Jul 02, 2018 10:19 am

Re: extract dynamical prices

Post by RomaneRomy » Fri Jul 06, 2018 8:05 am

I think I have to use the ID of those elements, but, I don't know how to get this ID...
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: extract dynamical prices

Post by chivracq » Fri Jul 06, 2018 10:18 am

RomaneRomy wrote:

Code: Select all

Windows10/
iMacros v12 enterprise edition/
Good morning,
I've been searching for so long, and I found answers on the forum, but it doesn't work for my case...I hope someone could help me.
I need to extract products transport cost on a website (such as amazon), but it depends on the number of products ordered.
When I create my macro on iMacros, I just underline the price with my mouse :

Code: Select all

TAG POS=1 TYPE=P ATTR=TXT:5,76<SP>€
But if I run my macro again and that this price changed, it still indicate 5.76 euros.

My question : how to extract in a better way dynamic informations ? Then I want this information in a csv.

template of my extraction :

Code: Select all

TAG POS=1 TYPE=P ATTR=TXT:5,76<SP>€ EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\UTILISATEUR\Documents\iMacros FILE=TSEfraisTransport1.csv

Best regards, Romane (from France)
Hum, so you moved from iMacros v10.0.2 for CR to iMB v12.0, ah-ah...! :wink:
RomaneRomy wrote:I think I have to use the ID of those elements, but, I don't know how to get this ID...
Yep, if the Price (= the 'TXT' Attr) is Dynamic, you need to use some other Attribute(s) like the 'ID' or the 'Class' of that 'P' Element.

And maybe if it's the only Price on that Page, or if there are not "too many" similar 'P' Elements with a '€' Sign, and the Position of "your" Price on the Page doesn't change, the following might work:

Code: Select all

TAG POS=1 TYPE=P ATTR=TXT:*<SP>€ EXTRACT=TXT
... but you might need to adapt the 'POS=1'...

You can identify that 'ID' and all other Attributes you could use from the Source Code, from an 'EXTRACT=HTM' on that Element or from the 'Full HTML' (= 'Expert Mode') Record Mode...

And you can as well probably use 'Relative Positioning', on the Name/Label of the Product for example as Anchor..., but it all depends on what will remain "Constant" on the Page and from the Logic in your Script...
- (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...
RomaneRomy
Posts: 6
Joined: Mon Jul 02, 2018 10:19 am

Re: extract dynamical prices

Post by RomaneRomy » Fri Jul 06, 2018 10:26 am

Yeah, that's what I tried : TAG POS=1 TYPE=P ATTR=TXT:*<SP>€ EXTRACT=TXT
Thank you for the confirmation.
best regards.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: extract dynamical prices

Post by chivracq » Fri Jul 06, 2018 10:50 am

RomaneRomy wrote:Yeah, that's what I tried :

Code: Select all

TAG POS=1 TYPE=P ATTR=TXT:*<SP>€ EXTRACT=TXT
Thank you for the confirmation.
best regards.
OK..., and does it work...?

"Confirmation"..., hum..., I cannot "confirm" anything as you didn't post the URL of the Page, "Confirmation" must come from you, ah-ah...! :wink:
- (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...
RomaneRomy
Posts: 6
Joined: Mon Jul 02, 2018 10:19 am

Re: extract dynamical prices

Post by RomaneRomy » Fri Jul 06, 2018 11:52 am

It worked :D
But I think it would not work if the relative place of the price on the page change...
Actually I don't know how to make my macros still working if the "structure" moves.
Best regards,
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: extract dynamical prices

Post by chivracq » Fri Jul 06, 2018 12:04 pm

RomaneRomy wrote:It worked :D
But I think it would not work if the relative place of the price on the page change...
Actually I don't know how to make my macros still working if the "structure" moves.
Best regards,
Ah OK, that's a good start then... :D

Well, the "relative place" of the Price will not change from the 'Product Name' that Price relates to...
"Relative" is always... well... "relative" to stg..., that's why you need to use some Element for the Anchor that will not "move" or that iMacros can locate and tag without ambiguity... That's the "Purpose" of 'Relative Positioning'...! 8)

I can't tell you more without looking at that Page and how it "behaves" and what changes and remains "constant"...
- (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