extract dynamical prices

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
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.
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: 7722
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)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...
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: 7722
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)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...
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: 7722
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)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...
Post Reply