Dropdown menu scraping

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 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
breezyguy
Posts: 7
Joined: Mon Sep 14, 2015 9:45 am

Dropdown menu scraping

Post by breezyguy » Mon Sep 14, 2015 9:50 am

Hello there,

I have problem creating dropdown menu size scraping code, Could you help me please ?

http://www.matchesfashion.com/intl/prod ... oat-156738

12 UK- sould out
14 UK
16 UK

I would like to get the data like " 12 UK- sould out ; 14 UK ; 16 UK " in an excel cell.

Thank you all.
chivracq
Posts: 9485
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Dropdown menu scraping

Post by chivracq » Tue Sep 15, 2015 4:33 pm

breezyguy wrote:Hello there,

I have problem creating dropdown menu size scraping code, Could you help me please ?

http://www.matchesfashion.com/intl/prod ... oat-156738

12 UK- sould out
14 UK
16 UK

I would like to get the data like " 12 UK- sould out ; 14 UK ; 16 UK " in an excel cell.

Thank you all.
CIM...! :mrgreen:

And what have you tried...?, I get it to work within a few seconds with my first try... :shock:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
breezyguy
Posts: 7
Joined: Mon Sep 14, 2015 9:45 am

Re: Dropdown menu scraping

Post by breezyguy » Wed Sep 16, 2015 4:17 pm

I am new to I macros and dont know about drop down menu coding. Can you help me on this please ?
chivracq
Posts: 9485
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Dropdown menu scraping

Post by chivracq » Wed Sep 16, 2015 4:52 pm

breezyguy wrote:I am new to I macros and dont know about drop down menu coding. Can you help me on this please ?
Yep if you answer my Questions, "CIM" is a Question because you didn't read the Forum Rules, nor any Documentation I guess... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
breezyguy
Posts: 7
Joined: Mon Sep 14, 2015 9:45 am

Re: Dropdown menu scraping

Post by breezyguy » Thu Sep 17, 2015 11:40 am

chivracq wrote: Yep if you answer my Questions, "CIM" is a Question because you didn't read the Forum Rules, nor any Documentation I guess... :idea:
sorry for that. I did not know about it.

I use firefox browser and free firefox add-on imacros, my operating system is Wİndows home 7, DO you need any other info ?

Thank you
breezyguy
Posts: 7
Joined: Mon Sep 14, 2015 9:45 am

Re: Dropdown menu scraping

Post by breezyguy » Thu Sep 17, 2015 11:42 am

I have tried below coding.

SET delimiter ","
TAG POS=1 TYPE=SELECT ATTR=ID:entrySizeVariant EXTRACT=TXTALL
SET TRIM EVAL("\"{{!EXTRACT}}\".replace(/^\\s*|\\s*$/g, \"\");")
SET replaced EVAL("'{{TRIM}}'.replace(/(\\d+)/g, '; $1').replace(';', '') + ' ';")
SET !EXTRACT NULL
ADD !EXTRACT {{replaced}}
chivracq
Posts: 9485
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Dropdown menu scraping

Post by chivracq » Thu Sep 17, 2015 2:22 pm

breezyguy wrote:
chivracq wrote: Yep if you answer my Questions, "CIM" is a Question because you didn't read the Forum Rules, nor any Documentation I guess... :idea:
sorry for that. I did not know about it.

I use firefox browser and free firefox add-on imacros, my operating system is Wİndows home 7, DO you need any other info ?

Thank you
Nearly good... :roll: => "CIM" becomes FCIM...! :mrgreen: (Read my Sig, that will speed up the process... :idea: )
breezyguy wrote:I have tried below coding.

Code: Select all

SET delimiter ","
TAG POS=1 TYPE=SELECT ATTR=ID:entrySizeVariant EXTRACT=TXTALL
SET TRIM EVAL("\"{{!EXTRACT}}\".replace(/^\\s*|\\s*$/g, \"\");")
SET replaced EVAL("'{{TRIM}}'.replace(/(\\d+)/g, '; $1').replace(';', '') + ' ';")
SET !EXTRACT NULL
ADD !EXTRACT {{replaced}}
Very good, you've come a long way already, I'm impressed...! :D

You've managed to locate the 'SELECT' Element as I noticed that only the corresponding 'SPAN' Element got recorded when I quickly had a look at your Site for my first Reply, and you've found the 'EXTRACT=TXTALL' Command which gives you all the Data you want and you've found 'EVAL()', using an impressive global 'replace()' Statement, perfect...!
I'm not good at global 'replace()' because I've never had the need for myself but your Statement looks good, without testing it, so what's the Problem now...?

And I'm not sure what is your goal with your 'delimiter' User Defined Variable at the beginning of your Script as you don't use it in the rest of your Script...
Or did you mean using '!DATASOURCE_DELIMITER' which is already set to "," by default...?
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Post Reply