473,383 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

cron perl script to navigate and down load a xls file

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use LWP;
  4. my $ua = new LWP::UserAgent;
  5.  
  6. $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8)");
  7.  
  8.  
  9.  
  10. my $request = new HTTP::Request("GET", "http://www.ptcrb.com/File/dcCom/components/dcFileManagerV3/actions/act_downloadNonDirect.cfm/filename/gry_al_11212007.xls");
  11.  
  12. my $response = $ua->request($request);
  13.  
  14. if ($response->is_success) {
  15.         print $response->content;
  16. }
  17. else
  18. {
  19.         print $response->status_line, "\n";
  20. }
  21.  
  22.  
  23. ==========================
  24.  
  25.  
  26. ##!/usr/bin/perl -w
  27. #use strict;
  28. use warnings;
  29.  
  30. #cpan module
  31.  use WWW::Mechanize;
  32.  my $mech = WWW::Mechanize->new();
  33.  
  34.  #login
  35.  my $url='http://www.ptcrb.com';
  36.  $mech->get( $url );
  37.  print $mech->status();
  38.  
  39.  $mech->form_name('login');
  40.  $mech->set_visible('username','passw') ;
  41.  $mech->click('btnLogin');
  42.  print $mech->status().'login';
  43.  $mech->click('/File/Example.cfm');
  44.  print $mech->status().'clicked';
  45.  
==========
pl help me
Dec 4 '07 #1
1 1813
numberwhun
3,509 Expert Mod 2GB
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl -w
  2. use strict;
  3. use LWP;
  4. my $ua = new LWP::UserAgent;
  5.  
  6. $ua->agent("Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8)");
  7.  
  8.  
  9.  
  10. my $request = new HTTP::Request("GET", "http://www.ptcrb.com/File/dcCom/components/dcFileManagerV3/actions/act_downloadNonDirect.cfm/filename/gry_al_11212007.xls");
  11.  
  12. my $response = $ua->request($request);
  13.  
  14. if ($response->is_success) {
  15.         print $response->content;
  16. }
  17. else
  18. {
  19.         print $response->status_line, "\n";
  20. }
  21.  
  22.  
  23. ==========================
  24.  
  25.  
  26. ##!/usr/bin/perl -w
  27. #use strict;
  28. use warnings;
  29.  
  30. #cpan module
  31.  use WWW::Mechanize;
  32.  my $mech = WWW::Mechanize->new();
  33.  
  34.  #login
  35.  my $url='http://www.ptcrb.com';
  36.  $mech->get( $url );
  37.  print $mech->status();
  38.  
  39.  $mech->form_name('login');
  40.  $mech->set_visible('username','passw') ;
  41.  $mech->click('btnLogin');
  42.  print $mech->status().'login';
  43.  $mech->click('/File/Example.cfm');
  44.  print $mech->status().'clicked';
  45.  
==========
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
Dec 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
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...
0
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....
21
KevinADC
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...
3
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/...
5
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...
3
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...
4
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...
3
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.