Last active
November 13, 2020 06:29
-
-
Save jschee/4fe8852e3fe40b4d02780ff182f56dbe to your computer and use it in GitHub Desktop.
ps5 walmart browser automation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "watir" | |
browser = Watir::Browser.new(:chrome, switches: ['--incognito']) | |
sleep 2 | |
browser.goto("https://www.walmart.com/ip/PlayStation-5-Console/363472942") ## or https://www.walmart.com/ip/Sony-PlayStation-5-Digital-Edition/493824815 | |
sleep 4 | |
browser.button(class: ["button", "spin-button", "prod-ProductCTA--primary", "button--primary"]).click | |
sleep 4 | |
browser.button(class: ["button", "ios-primary-btn-touch-fix", "hide-content-max-m", "checkoutBtn button--primary"]).click | |
sleep 4 | |
browser.button(class: ["button", "m-margin-top", "width-full", "button--primary"]).click | |
# browser.button(class: ["button", "cxo-continue-btn", "button--primary"]).click | |
sleep 8 | |
browser.text_field(id: "firstName").set "" | |
browser.text_field(id: "lastName").set "" | |
browser.text_field(id: "addressLineOne").set "" | |
browser.text_field(id: "phone").set "" | |
browser.text_field(id: "city").set "" | |
browser.text_field(id: "email").set "" | |
browser.select_list(id: "state").select "" | |
browser.text_field(id: "postalCode").set "" | |
sleep 3 | |
browser.button(class: ["button", "button--primary"]).click | |
sleep 5 | |
browser.text_field(id: "creditCard").set "" | |
browser.select_list(id: "month-chooser").select "" | |
browser.select_list(id: "year-chooser").select "" | |
browser.text_field(id: "cvv").set "" | |
sleep 65 #long sleep so i can do this manually incase... | |
browser.button(class: ["button", "persistent-footer-continue", "width-full", "button--primary"]).click | |
sleep 60 #long sleep so browser doesnt close on me and can manually do stuff... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment