Current location: Hot Scripts Forums » Programming Languages » Perl » Perl LWP iframe tag problem


Perl LWP iframe tag problem

Reply
  #1 (permalink)  
Old 11-12-09, 07:30 PM
tak_hot tak_hot is offline
New Member
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Perl LWP iframe tag problem

Dear all,

I am trying to download a PDF file from a web page.
I have used the following code:
use WWW::Mechanize;
my $mech = WWW::Mechanize->new( autocheck => 1 );
$mech->agent_alias( 'Windows IE 6' );
$mech->get("https://ecf.nynd.uscourts.gov/doc1/12501815060?pdf_toggle_possible=1&de_seq_num=17732 85&caseid=29430&got_receipt=1");
$mech->form_name('GetPass');
$mech->field(login => "xxx"); #Username
$mech->field(key => "xxx"); #Password
$mech->click();
print $mech->content;

Following is the content printed:

<html><head><title>CM/ECF LIVE - U.S. District Court - NYND</title>
<script language="javascript" src="/lib/dls_url.js"></script></head><body BGCOLOR=F9F9F9 TEXT=000000 ><div id="cmecfMainContent"><input type="hidden" id="cmecfMainContentScroll" value="0"><SCRIPT LANGUAGE="JavaScript">
document.cookie="PacerUser=\"li093301258064693 aDlYK1Zk9Vo\"; path=/; domain=.uscourts.gov;";
if ("PacerPref=receipt=Y; path=/ ; domain=.uscourts.gov".length > 0) {
document.cookie="PacerPref=receipt=Y; path=/ ; domain=.uscourts.gov;";
}
if ("PacerClient=\"\"; path=/ ; domain=.uscourts.gov".length > 0) {
document.cookie="PacerClient=\"\"; path=/ ; domain=.uscourts.gov;";
}
if ("ClientDesc=\"\"; path=/ ; domain=.uscourts.gov".length > 0) {
document.cookie="ClientDesc=\"\"; path=/ ; domain=.uscourts.gov;";
}
if ("https://ecf.nynd.uscourts.gov/doc1/12501815060?pdf_toggle_possible=1&de_seq_num=17732 85&caseid=29430&got_receipt=1".length > 0) {
location.assign("https://ecf.nynd.uscourts.gov/doc1/12501815060?pdf_toggle_possible=1&de_seq_num=17732 85&caseid=29430&got_receipt=1");
}
</SCRIPT><SCRIPT LANGUAGE="JavaScript">
var IsForm = false;
var FirstField;
function SetFocus() {
if(IsForm) {
if(FirstField) {
var ind = FirstField.indexOf('document.',0);
if(ind == 0)
{
eval(FirstField);
}
else
{
var Code = "document.forms[0]."+FirstField+".focus();";
eval(Code);
}
} else {
var Cnt = 0;
while(document.forms[0].elements[Cnt] != null) {
if(document.forms[0].elements[Cnt].type != "hidden") {
document.forms[0].elements[Cnt].focus();
break;
}
Cnt += 1;
}
}
}
return(true);
}
</SCRIPT>
</div></body></html>

However the actual page has a <iframe> tag within which the src attribute of tag has link to pdf.

id="cmecfMainContent"><input type="hidden" id="cmecfMainContentScroll" value="0">
<iframe src="/cgi-bin/show_temp.pl?file=1086820-0-.pdf&type=application/pdf" height="100%" width="100%" frameborder="0" scrolling="no">
<a href="/cgi-bin/show_temp.pl?file=1086820-0-.pdf&type=application/pdf">click here to view this file</a>
</iframe>
</body></html>

I have tried using FramesReady and mechanize, but no success. Kindly suggest how to get the pdf link.


Any help would be appreciated.

Thank you

Last edited by tak_hot; 11-12-09 at 07:37 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
perl newbie has a problem... fowler23 Perl 4 03-24-10 06:14 PM
Perl LWP loses html code?! jialanw Perl 22 04-13-09 03:14 PM
iframe background problem AimxmiA HTML/XHTML/XML 3 11-23-07 06:29 PM
Perl FormMail Problem ennanguyen2002 Perl 2 03-09-05 05:47 PM
problem getting the REAL src of an iframe kurt_nj JavaScript 0 06-23-04 05:22 PM


All times are GMT -5. The time now is 12:42 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.