Case for the Pros - Help with Looping & Excluding

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.

Case for the Pros - Help with Looping & Excluding

by d_86 on Thu May 19, 2016 3:39 pm

I am completely new to Imacros and I might need some help from you :)

My plan is to automatically sent a message to specific users on an online marketplace.

I would like to have a script for that which allows me to execute whenever I need it.

First, go to this website: http://www.kapaza.be

Enter a search term: for example "iphone 4"

Brings you here --> http://www.kapaza.be/nl/belgie?ca=0&l=0 ... =3&ps=&pe=

Then click on the Headline of every single result, scroll down the page and sent me message to the user by filling in: Name, E-Mail, Phone & Question. The Button to sent the message is "Verstuur je Bericht"

See here --> http://www.kapaza.be/nl/telefonie-acces ... 928109.htm

Now the tricky part comes...

1. How can I skip offers which have certain words in the Offer Headline? ( I only want to contact people who sell something and not those who are looking to buy an Iphone)
- For example words like: "looking for", "Buying" etc

2. How can I implement a function which checks if a member has already been contacted. I don´t want to sent the same message twice to the same user. I was thinking to save every Offer Headline to an excel / csv file after the member has been contacted. If the script goes into the Offer it checks if Offer Headline is in the csv File. If yes --> skip. Maybe there´s an easier option for this. Any help here is appreciated.

3. How can I run the script over several different pages. I don´t want to stop if the script hits the last result on page 1.

Hope someone is able to help me with this!

Here´s some additional info:

Working on a Mac OS X (10.9.5)
Browser: Chrome (version 50.0.2661.102 (64-bit))

Thanks a lot :)
d_86
 
Posts: 2
Joined: Thu May 19, 2016 2:56 pm

Re: Case for the Pros - Help with Looping & Excluding

by chivracq on Thu May 19, 2016 5:00 pm

d_86 wrote:I am completely new to Imacros and I might need some help from you :)

My plan is to automatically sent a message to specific users on an online marketplace.

I would like to have a script for that which allows me to execute whenever I need it.

First, go to this website: http://www.kapaza.be

Enter a search term: for example "iphone 4"

Brings you here --> http://www.kapaza.be/nl/belgie?ca=0&l=0 ... =3&ps=&pe=

Then click on the Headline of every single result, scroll down the page and sent me message to the user by filling in: Name, E-Mail, Phone & Question. The Button to sent the message is "Verstuur je Bericht"

See here --> http://www.kapaza.be/nl/telefonie-acces ... 928109.htm

Now the tricky part comes...

1. How can I skip offers which have certain words in the Offer Headline? ( I only want to contact people who sell something and not those who are looking to buy an Iphone)
- For example words like: "looking for", "Buying" etc

2. How can I implement a function which checks if a member has already been contacted. I don´t want to sent the same message twice to the same user. I was thinking to save every Offer Headline to an excel / csv file after the member has been contacted. If the script goes into the Offer it checks if Offer Headline is in the csv File. If yes --> skip. Maybe there´s an easier option for this. Any help here is appreciated.

3. How can I run the script over several different pages. I don´t want to stop if the script hits the last result on page 1.

Hope someone is able to help me with this!

Here´s some additional info:
Code: Select all
Working on a Mac OS X (10.9.5)
Browser: Chrome (version 50.0.2661.102 (64-bit))


Thanks a lot :)

Yep, do-able and not too complicated, you don't need to be a "Pro" to write such a Script...! :roll:

And, tja, willing to help a bit when you get stuck somewhere, but nobody will be writing your whole Script, I'm afraid..., and to be honest, I'm always a bit reluctant to help Users who want to use/misuse iMacros for kind of spamming other Users on some Forum or Site... :shock:

And you will need some Conditional Logic in your Script, but you are on CR on MacOS which only supports '.iim' Macros using iMacros Internal Commands meant for pure Click-Click-Click Web-Automation Actions and not for Conditional Behaviour. You would rather need to use iMacros for FF which supports JavaScript '.js' Scripts.
It can be done though in pure '.iim' using a few Techniques I've explained in this Thread:
- Workarounds for Conditional Logic in Macro Code
- (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: 6473
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: Case for the Pros - Help with Looping & Excluding

by d_86 on Fri May 20, 2016 9:29 am

Thanks for your reply.

I can post my current version as soon I get home.

Is it possible to write the entire script in the record mode or should I write all code by myself? So far I replied the steps (click on Title, paste message --> sent message & click back to main overview) 3 times to have a base for my script.

My plan was to build in the loop function first and after that care about the exclusions.

First problem which came up with the SET !LOOP n is that i don´t know how to implement it. Do I have to set a number somewhere to tell the script it has to repeat 100 times?

I also would like to know if the option to write the Headlines into an excel file is the right way to do it.

Any help here would be appreciated :)
d_86
 
Posts: 2
Joined: Thu May 19, 2016 2:56 pm

Re: Case for the Pros - Help with Looping & Excluding

by chivracq on Sun May 22, 2016 1:42 am

d_86 wrote:Thanks for your reply.

I can post my current version as soon I get home.

Is it possible to write the entire script in the record mode or should I write all code by myself? So far I replied the steps (click on Title, paste message --> sent message & click back to main overview) 3 times to have a base for my script.

My plan was to build in the loop function first and after that care about the exclusions.

First problem which came up with the SET !LOOP n is that i don´t know how to implement it. Do I have to set a number somewhere to tell the script it has to repeat 100 times?

I also would like to know if the option to write the Headlines into an excel file is the right way to do it.

Any help here would be appreciated :)

Pfff, not really sure how to respond to your previous Post and that you don't get offended... (well, get offended, and I won't try to help any further of course, at least I responded to your Thread in an attempt to provide some (potential...!) Help... :idea: ), you ask Qt's that you would answer by yourself if you played for 15 min with iMacros, recording, playing, playing/looking at some Demo Macros..., sorry we, other (Advanced) Users (well, me at least) are here to help you with with a real Pb, when you get really stuck somewhere, not to tell you to record a Macro and play it again to see if and how it works..., and to read a little bit of the Documentation to have an idea what iMacros can do for you... :idea:

=> Hope you managed to find the 'Play: Repeat Macro' Button on the iMacros Side-Panel by the time you reached the end of my Msg...!
- (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: 6473
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: No registered users and 9 guests

-->