0

I am trying to make it where every time I visit a FootLocker/FootAction etc../ sneaker page, it automatically picks my shoe size, adds it to the cart, and checks out for me. Every time I try to run the script, I keep getting this error

ERROR: Execution of script 'My Fancy New Userscript' failed! selenium is not defined

Here is my script

// ==UserScript==
// @name       FOOTLOCKER.ACTION
// @namespace  http://*/*
// @version    0.1
// @description  enter something useful
// @match      http://*/*
// @copyright  2012+, You
// ==/UserScript==

selenium.select("class=selectBox-label", "10"); // this selects size 10 
selenium.click("class=cmConversionEventSizeSelection");
selenium.waitForElement("class=addToCartButton"); 
selenium.click("class=addToCartButton");
selenium.waitForElement("class=checkout");
selenium.click("class=checkout")

Here is the Target Page

Munawir
  • 3,346
  • 9
  • 33
  • 51

1 Answers1

0

Your problem is that Selenium injects its code directly into the page, but your script runs in a sandbox/different scope.

Also this question is a duplicate of Why does my Tampermonkey script throw "Selenium is not defined"? and should be closed as such.

Community
  • 1
  • 1
Xaekai
  • 359
  • 3
  • 9