I’m trying to log into a (what I assume to be a) webapp and I get stuck trying to log into the website. Using WWW::Mechanize does work but in the responses from my post, content it print nothing more than a couple HTML Javascript:
<HTML>
<SCRIPT Language=JAVAScript>
var msgTimerID;
var strForceLogOff = "false";
function WindowOnLoad(){
if ("false" == "true" && "false" == "false")
MerlinSystemMsg("",64);
if ("false"=="true")
msgTimerID = window.setInterval("MerlinSystemMsg(10095,64)", 300000,'javascript');
}
function MyShowModal(){
showModalDialog("", window, strFeatures);}
function clearMsgInterval(){
window.clearInterval(msgTimerID);
}
function WindowOnUnLoad(){
if(top.frames(0).document.getElementById("OPMODE").value =="LOGOFF"){
strFeatures = "width=1,height=1,left=1000,top=1000,toolbar=no,scrollbars=no,menubar=no,location=no,directories=no,status=yes,resizable=1";
window.open("ForceLogOff.aspx","forcelogout",strFeatures);
}
}
window.onbeforeunload = WindowOnUnLoad;
window.onload = WindowOnLoad;
</SCRIPT>
<FRAMESET ROWS="57px, *" BORDER=0 FRAMEBORDER=0 STYLE="background-color=transparent">
<FRAME TITLE="Service Desk Express Navigator" SRC="Options_split.aspx?NavigatorName=1065" NORESIZE>
</HTML>
There is also this Frame Title that has the src:
FRAME TITLE="Service Desk Express Navigator" SRC="options_nailogo.aspx" MARGINWIDTH=0 MARGINHEIGHT=0 NORESIZE scrolling=no
In general, how would I handle a response like this when the content is not the websites source, but mostly scripts?
That content is the website source 🙂
How WWW::Mechanize deals with FRAME SRC as a link:
You’ll want to use
follow_linkon that link.