IF ELSE using iMacros on an e-commerce website

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
ssl2k
Posts: 3
Joined: Tue Jun 15, 2021 1:54 pm

IF ELSE using iMacros on an e-commerce website

Post by ssl2k » Tue Jun 15, 2021 2:12 pm

Hi, this is my first post, and i have been reading past posts on this topic but still couldn't apply what I have read into my scenario.

I'm currently using Windows 10, Google Chrome ver91 (the latest release, i always kept it up to date), and iMacros extension in chrome (version 10.1.1)
This is the website im using iMacros on: Shopee Malaysia

The product i want to buy is currently out of stock, but it is accessible when the seller re-lists it and then restocks at a fixed time. At that time, the stock will be "0 piece available"
This is an example product page Controller for Switch (so you can get the picture) and i want it to be able to check the stock amount. if it is "0 piece available", i want it to GOTO the first line which reloads the page and then performs the IF ELSE statement again. basically i want the statement to be:
if (stock == 0):
refreshpage
else:
proceed with the remaining lines

is it possible to do this on iMacros extension or do i have to resort to the paid version? Thank you for all the help.
chivracq
Posts: 9806
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: IF ELSE using iMacros on an e-commerce website

Post by chivracq » Tue Jun 15, 2021 2:32 pm

ssl2k wrote:
Tue Jun 15, 2021 2:12 pm
Hi, this is my first post, and i have been reading past posts on this topic but still couldn't apply what I have read into my scenario.

I'm currently using Windows 10, Google Chrome ver91 (the latest release, i always kept it up to date), and iMacros extension in chrome (version 10.1.1)
This is the website im using iMacros on: Shopee Malaysia

The product i want to buy is currently out of stock, but it is accessible when the seller re-lists it and then restocks at a fixed time. At that time, the stock will be "0 piece available"
This is an example product page Controller for Switch (so you can get the picture) and i want it to be able to check the stock amount. if it is "0 piece available", i want it to GOTO the first line which reloads the page and then performs the IF ELSE statement again. basically i want the statement to be:

Code: Select all

if (stock == 0):
    refreshpage
else:
    proceed with the remaining lines
is it possible to do this on iMacros extension or do i have to resort to the paid version? Thank you for all the help.

=> FCI:

Code: Select all

iMacros for CR v10.1.1, 'Free', CR91, Win10.
You are a bit "in luck", some other User had recently more or less the same Scenario/Requirements for a Script on the same Site...: 8)
- What script to refresh the page until the item is available
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
ssl2k
Posts: 3
Joined: Tue Jun 15, 2021 1:54 pm

Re: IF ELSE using iMacros on an e-commerce website

Post by ssl2k » Tue Jun 15, 2021 2:41 pm

If i understood it correctly, that means by using the ERRORIGNORE, i should be able to loop the script even if the buy now button is disabled right? so when the next loop comes, hopefully by then it has restocked.

tell me if im wrong :)
chivracq
Posts: 9806
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: IF ELSE using iMacros on an e-commerce website

Post by chivracq » Tue Jun 15, 2021 2:49 pm

ssl2k wrote:
Tue Jun 15, 2021 2:41 pm
If i understood it correctly, that means by using the ERRORIGNORE, i should be able to loop the script even if the buy now button is disabled right? so when the next loop comes, hopefully by then it has restocked.

tell me if im wrong :)

Yep, that's correct..., but you need to read the whole Thread and understand how the User "progressed" towards their Final Script and getting it to work... :idea:

And that other User also wanted a Mechanism to increment the Number of "Piece(s) available" to only click on the 'Buy now' Button if there were at least 2 Items available... Not sure if you want that Mechanism as well... :|
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
ssl2k
Posts: 3
Joined: Tue Jun 15, 2021 1:54 pm

Re: IF ELSE using iMacros on an e-commerce website

Post by ssl2k » Tue Jun 15, 2021 2:54 pm

i had no problems on incrementing the quantity. Only needed the "buy when its in stock" part of the script :D Thank you a lot, by the way!
chivracq
Posts: 9806
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: IF ELSE using iMacros on an e-commerce website

Post by chivracq » Tue Jun 15, 2021 3:01 pm

ssl2k wrote:
Tue Jun 15, 2021 2:54 pm
i had no problems on incrementing the quantity. Only needed the "buy when its in stock" part of the script :D Thank you a lot, by the way!

Alright, perfect then if the Script from the "other" Thread already works for you as well... :D

Thanks to the other User then, I would think..., they did all the "hard Work" already, ah-ah...! :wink:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
chivracq
Posts: 9806
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: IF ELSE using iMacros on an e-commerce website

Post by chivracq » Sat Jun 19, 2021 5:01 pm

Posting on behalf of a "New" User:
Re: IF ELSE using iMacros on an e-commerce website
Post by kimwelnes » 19/06/2021 - 17:57
Post awaiting approval: [Disapprove] - [Approve]

I also have the same problems. Thanks for the solutions.

EDIT: Oh...!, the User is Fake indeed, like I suspected, they've already tried (1 day later) to post another fake "Thanks, #MeToo" in some other Thread...
But OK, I leave this Quote as "Explanation" for the 2nd Part of my Post, and the User will be deleted during the next "Clean-up Round", no big deal... :|

>>>

Alright, looks like this Thread is already attracting some "Low Quality" Posts with "Thank you. #MeToo"..., but I "usually" don't approve such Low Qlt Posts as they "usually" all turn out to be "Fake", from "Fake" Users and (future) Spammers and I don't want to have to monitor those Users until they will invariably silently edit their Post (or Sig) "one day" to add some Spam... :shock:

=> For New Users who would like to post in this Thread, make sure to put "a bit more" Quality than the one in this Quote, by including your Final Script and mentioning your FCI, to add any "Value" to this Thread... :idea:
And make sure to register to the Forum from a "clean" and "real" IP. => Using a VPN or Proxy for example is a No Go, sorry... :!:
And your IP should "match" the Country/Language of the Site... I don't "expect" a User with some Russian IP for example to speak Malaysian, ah-ah...! :P
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- 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