SHARE
TWEET

Untitled

a guest Mar 20th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. require 'watir'
  2.  
  3. #start = new + goto
  4. b = Watir::Browser.start 'http://www.designious.com/t-shirt-designs?limit=90&mode=list'
  5. counts = 1
  6. while counts <= 90
  7.     #find and click on newtab
  8.     btns = b.elements css: '.product-name a'
  9.     btns.first.click(:control)
  10.     #use newtab
  11.     b.windows.last.use
  12.  
  13.     #search and click buttons
  14.     btns = b.elements css: '.button.btn-cart'
  15.     btns.first.click
  16.  
  17.     #cloes new window
  18.     b.windows.last.close
  19.     counts+=1
  20. end
RAW Paste Data
Pastebin PRO Summer Special!
Get 60% OFF on Pastebin PRO accounts!
Top