Interactive shell like irb or pry is best friend to learn how to write code in programming language. Playing with Capybara from interactive shell session also very good to get used to Capybara's powerful API. You can load Capybara from irb/pry console, but it requires some additional setup. Instead of it, just put a prepared executable script and run it from the shell. $ capybara example.com inclu