To do this you have to have a bit of background on web development and/or some background info on the captive portal you're faced with.
Here's how I did it with the cisco wireless APs at work. It's a bit more complicated than you described, since I have to use a username/password. You might be able to get away with just sending in the POST to click the Accept button.
First, I installed curl on my rooted device, and I got the wifi connect plugin. I used tcpdump to record the traffic between my phone and the AP, but you could do the same thing with a laptop if you don't want to try running tcpdump on your phone.
A naive captive portal will let you just send in the POST to accept the conditions and off you go. Some captive portals are smarter than others. For the smart ones, like the one I deal with at work, the game plan is to fake as much as possible that you're using a real browser and interactively tapping on the page.
I use variables to hold the command lines and stdout and stderr for curl. It makes it easier to dump it all into the log file to debug.
I hope this has helped; you will have to do a bit to get it to work for your situation.
Here's the XML of my task.
<TaskerData sr="" dvi="1" tv="4.4u3">
<Task sr="task57">
<cdate>1387306232289</cdate>
<edate>1409356411653</edate>
<id>57</id>
<nme>Wifi Logon</nme>
<pri>10</pri>
<stayawake>true</stayawake>
<Action sr="act0" ve="6">
<code>425</code>
<Int sr="arg0" val="1"/>
</Action>
<Action sr="act1" ve="6">
<code>7514</code>
<se>false</se>
<Bundle sr="arg0">
<Vals sr="val">
<com.twofortyfouram.locale.intent.extra.BLURB>"WorkWifi"</com.twofortyfouram.locale.intent.extra.BLURB>
<com.twofortyfouram.locale.intent.extra.BLURB-type>java.lang.String</com.twofortyfouram.locale.intent.extra.BLURB-type>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>"WorkWifi"</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID>
<jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>java.lang.String</jp.meridiani.apps.wificonnect.extra.STRING_AP_SSID-type>
<net.dinglisch.android.tasker.subbundled>true</net.dinglisch.android.tasker.subbundled>
<net.dinglisch.android.tasker.subbundled-type>java.lang.Boolean</net.dinglisch.android.tasker.subbundled-type>
</Vals>
</Bundle>
<Str sr="arg1" ve="3">jp.meridiani.apps.wificonnect</Str>
<Str sr="arg2" ve="3">WiFi Connect</Str>
<Int sr="arg3" val="0"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%WIFII</lhs>
<op>5</op>
<rhs>WorkWifi</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act10" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%curlcmd</Str>
<Str sr="arg1" ve="3">cd /sdcard/logon ; curl -k -A "Mozilla/5.0 (Linux; Android 4.1.2; SCH-I535 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36"
https://1.1.1.1/login.html?redirect=slashdot.org/</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act11" ve="6">
<code>123</code>
<se>false</se>
<Str sr="arg0" ve="3">%curlcmd</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3">%curlo</Str>
<Str sr="arg4" ve="3">%curle</Str>
<Str sr="arg5" ve="3">%curlr</Str>
</Action>
<Action sr="act12" ve="6">
<code>410</code>
<se>false</se>
<Str sr="arg0" ve="3">logon.log</Str>
<Str sr="arg1" ve="3">+++++++++++++++++++++
%TIME
cmd:[%curlcmd]
output:[%curlo]
res:[%curlr]
err:[%curle]</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="1"/>
</Action>
<Action sr="act13" ve="6">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act14" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%curlcmd</Str>
<Str sr="arg1" ve="3">cd /sdcard/logon ; curl -k -L -A "Mozilla/5.0 (Linux; Android 4.1.2; SCH-I535 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36" -e "
https://1.1.1.1/login.html?redirect=slashdot.org/" -d buttonClicked=4 -d err_flag=0 -d err_msg= -d info_flag=0 -d info_msg= -d redirect_url=http%3A%2F%2Fslashdot.org%2F -d username=MyUserName -d password=password123
https://1.1.1.1/login.html</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act15" ve="6">
<code>123</code>
<se>false</se>
<Str sr="arg0" ve="3">%curlcmd</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3">%curlo</Str>
<Str sr="arg4" ve="3">%curle</Str>
<Str sr="arg5" ve="3">%curlr</Str>
</Action>
<Action sr="act16" ve="6">
<code>410</code>
<se>false</se>
<Str sr="arg0" ve="3">logon.log</Str>
<Str sr="arg1" ve="3">+++++++++++++++++++++
%TIME
cmd:[%curlcmd]
output:[%curlo]
res:[%curlr]
err:[%curle]</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="1"/>
</Action>
<Action sr="act17" ve="6">
<code>43</code>
</Action>
<Action sr="act18" ve="6">
<code>548</code>
<Str sr="arg0" ve="3">connected!</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act19" ve="6">
<code>410</code>
<se>false</se>
<Str sr="arg0" ve="3">logon.log</Str>
<Str sr="arg1" ve="3">+++++++++++++++++++++
%TIME
curlo: [%curlo]
Still connected</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="1"/>
</Action>
<Action sr="act2" ve="6">
<code>426</code>
<Int sr="arg0" val="2"/>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%WIFII</lhs>
<op>5</op>
<rhs>WorkWifi</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act20" ve="6">
<code>38</code>
</Action>
<Action sr="act21" ve="6">
<code>20</code>
<on>false</on>
<App sr="arg0">
<appClass>org.sshtunnel.SSHTunnel</appClass>
<appPkg>org.sshtunnel</appPkg>
<label>SSHTunnel:SSHTunnel</label>
</App>
<Str sr="arg1" ve="3"/>
<Int sr="arg2" val="0"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%INETCONNECTED</lhs>
<op>8</op>
<rhs>0</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act22" ve="6">
<code>548</code>
<on>false</on>
<Str sr="arg0" ve="3">Done</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act3" ve="6">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Action sr="act4" ve="6">
<code>547</code>
<Str sr="arg0" ve="3">%curlcmd</Str>
<Str sr="arg1" ve="3">cd /sdcard/logon ; curl -k -A "Mozilla/5.0 (Linux; Android 4.1.2; SCH-I535 Build/JZO54K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.59 Mobile Safari/537.36"
http://slashdot.org</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
</Action>
<Action sr="act5" ve="6">
<code>123</code>
<se>false</se>
<Str sr="arg0" ve="3">%curlcmd</Str>
<Int sr="arg1" val="0"/>
<Int sr="arg2" val="0"/>
<Str sr="arg3" ve="3">%curlo</Str>
<Str sr="arg4" ve="3">%curle</Str>
<Str sr="arg5" ve="3">%curlr</Str>
</Action>
<Action sr="act6" ve="6">
<code>37</code>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%curlo</lhs>
<op>4</op>
<rhs>Web Authentication Redirect</rhs>
</Condition>
</ConditionList>
</Action>
<Action sr="act7" ve="6">
<code>548</code>
<Str sr="arg0" ve="3">Not connected!</Str>
<Int sr="arg1" val="0"/>
</Action>
<Action sr="act8" ve="6">
<code>410</code>
<se>false</se>
<Str sr="arg0" ve="3">logon.log</Str>
<Str sr="arg1" ve="3">+++++++++++++++++++++
%TIME
cmd:[%curlcmd]
output:[%curlo]
res:[%curlr]
err:[%curle]</Str>
<Int sr="arg2" val="1"/>
<Int sr="arg3" val="1"/>
</Action>
<Action sr="act9" ve="6">
<code>30</code>
<Int sr="arg0" val="0"/>
<Int sr="arg1" val="2"/>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
</Action>
<Img sr="icn" ve="2">
<nme>hl_device_access_network_wifi</nme>
</Img>
</Task>
</TaskerData>