I'd like to build a super simple program that allows me to basically execute a Ruby file and navigate a website. This simple task has proven to be excruciatingly painful and difficult.

Agreed learning new tech/stuff can often be frustrating at first but of course gets easier as you gain experience, driving a web-browser currently isn't particularly trivial so I'd not call it a simple task, that said selenium webdriver and it's language bindings have matured to a level that it's quite nicely abstracted.

So you can use the selenium webdriver for this.

Install the "selenium-webdriver" gem, some browsers will require you download a webdriver so taking chrome as an example, download the chromedriver.

If you don't place the webdriver in your executable path then you can tell Selenium where it is, here's a quick & dirty example:

require "selenium-webdriver"

Selenium::WebDriver::Chrome.driver_path = "<path to chromedriver>"
webdriver = Selenium::WebDriver.for :chrome
webdriver.get "http://www.google.com"

query = webdriver[name: "q"]
query.send_keys "Selenium"
query.submit

See more regarding the Selenium Ruby bindings here.

FYI: I'm on a *nix, your mileage may vary with this example on other OS but it should work fine.

/r/ruby Thread