open links in a html page

Ajar ajartaknev at
Tue Aug 16 16:52:05 CEST 2005


Using urllib2,ClinetForm and ClinetCookie modules I have logged into my
ISPs web site and managed to fetch the first page. Now, on this page
there is this link:

<a href="#"  onclick="check(4);return false;" class="zi01">Service

I need to click this link from python code. How do I do it? check(4) is
the following javascript function:


function check(parameter){
            parent.frames(0).location.href="userinfo.jsp" + "?" + new
        }else if(parameter==2){
            parent.frames(0).location.href="modipswd.jsp" + "?" + new
        }else if(parameter==3){
             parent.frames(0).location.href="cardrecharge.jsp" + "?" +
new Date().toString();
        }else if(parameter==4){
            parent.frames(0).location.href="serviceRecords.jsp" + "?" +
new Date().toString();
        }else if(parameter==5){
             parent.frames(0).location.href="rateSelectResult.jsp" +
"?" + new Date().toString();
        else if(parameter==6){
             parent.frames(0).location.href="stopService.jsp" + "?" +
new Date().toString();
        else if(parameter==7){
             if (confirm("Are you sure to exit?")){
                return true;
                return false;
        }else if(parameter==8){
             parent.frames(0).location.href="cancelService.jsp" + "?" +
new Date().toString();
             return false;

More information about the Python-list mailing list