-
#!/usr/bin/perl -w
-
use strict;
-
use LWP;
-
my $ua = new LWP::UserAgent;
-
-
$ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8)");
-
-
-
-
my $request = new HTTP::Request("GET", "http://www.ptcrb.com/File/dcCom/components/dcFileManagerV3/actions/act_downloadNonDirect.cfm/filename/gry_al_11212007.xls");
-
-
my $response = $ua->request($request);
-
-
if ($response->is_success) {
-
print $response->content;
-
}
-
else
-
{
-
print $response->status_line, "\n";
-
}
-
-
-
==========================
-
-
-
##!/usr/bin/perl -w
-
#use strict;
-
use warnings;
-
-
#cpan module
-
use WWW::Mechanize;
-
my $mech = WWW::Mechanize->new();
-
-
#login
-
my $url='http://www.ptcrb.com';
-
$mech->get( $url );
-
print $mech->status();
-
-
$mech->form_name('login');
-
$mech->set_visible('username','passw') ;
-
$mech->click('btnLogin');
-
print $mech->status().'login';
-
$mech->click('/File/Example.cfm');
-
print $mech->status().'clicked';
-
==========
pl help me
1 1827 numberwhun 3,509
Recognized Expert Moderator Specialist -
#!/usr/bin/perl -w
-
use strict;
-
use LWP;
-
my $ua = new LWP::UserAgent;
-
-
$ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8)");
-
-
-
-
my $request = new HTTP::Request("GET", "http://www.ptcrb.com/File/dcCom/components/dcFileManagerV3/actions/act_downloadNonDirect.cfm/filename/gry_al_11212007.xls");
-
-
my $response = $ua->request($request);
-
-
if ($response->is_success) {
-
print $response->content;
-
}
-
else
-
{
-
print $response->status_line, "\n";
-
}
-
-
-
==========================
-
-
-
##!/usr/bin/perl -w
-
#use strict;
-
use warnings;
-
-
#cpan module
-
use WWW::Mechanize;
-
my $mech = WWW::Mechanize->new();
-
-
#login
-
my $url='http://www.ptcrb.com';
-
$mech->get( $url );
-
print $mech->status();
-
-
$mech->form_name('login');
-
$mech->set_visible('username','passw') ;
-
$mech->click('btnLogin');
-
print $mech->status().'login';
-
$mech->click('/File/Example.cfm');
-
print $mech->status().'clicked';
-
==========
pl help me
This does nothing to get you any assistance. You posted code, but no explanation as to what your issue is, no error messages, nothing.
If you want help, then you are going to have to provide as much information as you possibly can. Just posting your code and saying "pl help me" doesn't tell us what is wrong.
Also, "pl" can be expanded to the proper word, PLEASE. This is not SMS text messaging and we are not limited to 160 characters.
Regards,
Jeff
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: JS |
last post by:
I go to a website once a week to download public data. Upon submitting
a form, a text file is producted and I get the usual Windows dialog
box asking if I would like to open or save the text file locally. I
save it locally.
I am thinking about setting up a php script on an Apache server I use
to host some websites. Basically, I would like the script (which is
nothing more than a pre-populated form) to run as a cron job, get the
text...
|
by: Kirt Loki Dankmyer |
last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile
it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of
different switches, but I can't get it to compile. I need it to be
compiled with threads.
Anyone have any wisdom on how best to do this?
Here's a transcript of my latest attempt. It's long; you might want to
skip to the bottom, where I try "make" and the fatal errors start
happening.
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Uploading files from a local computer to a remote web server has many useful purposes, the most obvious of which is the sharing of files. For example, you upload images to a server to share them with other people over the Internet. Perl comes ready equipped for uploading files via the CGI.pm module, which has long been a core module and allows users...
|
by: davidiwharper |
last post by:
Hello everyone,
I am running a database maintenance script to remove old entries from a log file.
The script runs as expected when initiated manually:
./maintain.pl $HOME/website/database/ $HOME/logs/
|
by: jcor |
last post by:
Hi, I'm trying to run my first cron job, probably it's missing something.
I created a perl script just to test, it's called "teste"
!/usr/bin/perl
open(DATA,">>/home/joao/files/output");
@Now = localtime(time);
print DATA "@Now\n";
exit ;
| |
by: uzzi |
last post by:
I don't know how to make a php script to work via cron...I want to make it run daily...My server API is CGI/Fast CGI.I have hosting from godaddy and in the help section i found that i have to specify the interpreter manually...look what it says:
i've tried with /web/cgi-bin/php "$HOME/html/path/to/my/script.php as command and it doesn't work.
if i run the script in browser it works...what should i introduce as a command..and do i have...
|
by: Phil |
last post by:
I have a php script that queries some Oracle DB and outputs a single
line of plain text with <brat the end for each query. This is
Apache2, php4.4.8 and Oracle Instant Client 10.1.0.5 all on CentOS 4.4
32bit. Php does run as an Apache SO.
It works perfectly if I just hit the page in a web-browser (output to
browser).
It works *perfectly* from the command line (dumps the text to the file
per the redirect)
|
by: Zudnic |
last post by:
Hi, long time listener, first time caller so to speak. Thanks to everyone who has answered other questions that I've found and used.
I'm self-taught in Perl and have been hacking at it for more than five years now, so your patience with me is appreciated.
Here's my issue. I have a Perl script (say, myscript.cgi) that is set to run on a cron job. It has a require line to another function library. (This is a procedural program, not OO):...
|
by: Cameron Simpson |
last post by:
On 17Aug2008 21:25, John Nagle <nagle@animats.comwrote:
Because $HOSTNAME is a bash specific variable, set by bash but NOT
EXPORTED! Like $0 and a bunch of other "private" variables, subprocesses
do not inherit this value. From "man bash":
Shell Variables
The following variables are set by the shell:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |