Bash script to click button on an HTML page I'm trying to write a Bash script that opens a browser, clicks an HTML button on a webpage, and closes the browser after getting response. I need this script to be executable from within Terminal. If not a Bash script, then maybe a Python script.

Form is: 

&lt;form method="post" action="duophones?yc=sasv1S2f8mXKITRJS1XrenZ30SA-" enctype="application/x-www-form-urlencoded"&gt; 
&lt;input name="phone" value="+15551231235" type="hidden"&gt;
&lt;input name="action" value="dapact" type="hidden"&gt;
&lt;input name="session" value="0" type="hidden"&gt;
&lt;button class="c01 c01v0" name="action" type="submit" value="Activate +15551231234 over SMS (recommended)" override="true"&gt;Activate +15551231234 over SMS (recommended)&lt;/button&gt; 
&lt;/form&gt;


Script I have is:

curl -d value="Activate +15551231234 over SMS (recommended)" www.testpage.com

Any help or direction would be appreciated!
You should consider using opensource Selenium.

With a Selenium IDE plugin to Firefox you can record your actions (opening a page, clicking on a button), replay these songs, and generate Python or Ruby scripts rich you can customise and call from CLI.

Sample script testing default Apache availability might look like this:

#!/usr/local/bin/python

DEST_URL='http://webserver.dev/'

import unittest
from selenium import webdriver
from selenium.webdriver.common.proxy import *

class WebInterfaceTest(unittest.TestCase):

  def setUp(self):
     self.driver = webdriver.Firefox()

  def tearDown(self):
     self.driver.quit()

  def test_web_interface(self):
    self.driver.get(DEST_URL)
    self.assertIn('Apache2 Debian Default Page: It works', self.driver.title)

if __name__ == "__main__":
  unittest.main()