|
|
Up |
|
|
  |
Author: JackJack
Date: Feb 19, 2008 23:15
Hi there, does anyone skilled in the art of LWP (or other perl module)
and screen scraping know how to do the equivalent of a "file", "save
as" html content ? Some webpages arent scrapeable but when you save
down their content to a local file its available. Any ideas would be
great.
Also, if there is a drop down + button to select content BUT in the
HTML source no "submit" entry at all, how does one remote control a
user selection without this post handle ?
Thanks in advance,
Jack
|
| |
|
| |
6 Comments |
|
  |
Author: axtensaxtens
Date: Feb 19, 2008 22:44
G'day everyone
How would I return an array of arrays from perl, eg
my @r = [1, 2, [3,4]];
such that VB/VBScript would think the data to be
r = array(1,2,array(3,4))
This is PerlCtrl specific I know, and yes I should take it to the
ActiveState list, but I thought I'd ask here anyway, just in case.
Kind regards,
Bruce.
|
| |
|
| |
4 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Feb 19, 2008 18:03
This is an excerpt from the latest version perlfaq4.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
4.23: How do I find matching/nesting anything?
This isn't something that can be done in one regular expression, no
matter how complicated. To find something between two single characters,
a pattern like "/x([^x]*)x/" will get the intervening bits in $1. For
multiple ones, then something more like "/alpha(.*?)omega/" would be
needed. But none of these deals with nested patterns. For balanced
expressions using "(", "{", "[" or "<" as delimiters, use the CPAN
module Regexp::Common, or see "(??{ code })" in perlre. For other cases,
you'll have to write a parser.
|
| Show full article (2.76Kb) |
|
no comments
|
|
  |
Author: TelemachTelemach
Date: Feb 19, 2008 15:29
I'm wondering if there is a some kind of a tool or a way to easily
detect the forms and all needed data to later submit using LWP. For
example there is this page :
http://www.ivosoftware.com/ivonaonline.php
Firefox says there is a form but hidden, I can get some data but still
no luck in submitting.
Is it necessary to know all the details ? maybe there is a module that
I can instruct to find a second textarea form, fill with content and
then press a button.
BTW: After you click 'Read Now' a page is responding with mp3 file so
is it possible to get this downloaded via Perl ? or do I have to parse
in search for mp3 link and then wget ?
- Telemach -
|
| |
|
3 Comments |
|
  |
Author: Phil PowellPhil Powell
Date: Feb 19, 2008 13:09
Consider my code snippet:
use strict;
use warnings;
use HTTP::Cookies;
use WWW::Mechanize;
use LWP::Debug qw(+);
my $mech = WWW::Mechanize->new();
$mech->agent_alias('Windows IE 6');
$mech->cookie_jar(HTTP::Cookies->new(autosave => 1));
$mech->add_header('UID' => 'phil', 'cn' => 'CN', 'id' => '777');
my $response = $mech->get('https://www.example.com');
die "Error at https://www.example.com\n", $response->status_line, "\n
Aborting" unless $response->is_success;
$response = $mech->response;
for my $key ($response->header_field_names()) {
print "response[$key] = ", $response->header($key), "\n";
}
|
| Show full article (0.94Kb) |
|
4 Comments |
|
  |
Author: PerlFAQ ServerPerlFAQ Server
Date: Feb 19, 2008 12:03
This is an excerpt from the latest version perlfaq4.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
4.14: How can I compare two dates and find the difference?
(contributed by brian d foy)
You could just store all your dates as a number and then subtract. Life
isn't always that simple though. If you want to work with formatted
dates, the "Date::Manip", "Date::Calc", or "DateTime" modules can help
you.
--------------------------------------------------------------------
|
| Show full article (1.30Kb) |
|
no comments
|
|
  |
|
|
  |
Author: Ignoramus9014Ignoramus9014
Date: Feb 19, 2008 11:37
I would like to know what are the "most recommended" perl modules for
testing websites. For example, my typical task would be
- connect to IP address A
- request webpage B http://B/page.html
- check that it contacts a keyword C
What is important is that address A (my test or backup website) does
not necessarily match virtual host name B.
I read on Test::WWW::Mechanize, which I like a lot as I am very
familiar with WWW::Mechanize, but it does not seem to offer this
ability (connect to a given IP but use a unrelated virtual address).
Thanks
i
|
| |
|
6 Comments |
|
  |
Author: BHBH
Date: Feb 19, 2008 09:15
Hi,
I am reading in an comma separator file,
line 1: Field 1, field 2, field 3.., field n
line 2: Field 1, field 2, field 3.., field n
I would like to create a data structure to representing the whole
file.
What is an efficient and easy way to store the above such that, for a
given value for field i, I can extract an array of values for field j,
where 1<=i,j<=n? It's a bit like asking what the best way to store a
spreadsheet is.
Hash of anonymous arrays? How will the syntax be?
Thanks in advance.
Regards,
BH
|
| |
|
4 Comments |
|
  |
|
|
  |
Author: Petr ViletaPetr Vileta
Date: Feb 19, 2008 08:21
I have string in cp1250 codepage and I need to use regexp to extract part of
string. All is simple but I want to run the same script under Perl 5.6.1 and
5.8. And here is the problem.
Example 1
-------------
require utf8 if($] > 5.006001);
$string = "Telefón: 123456789\nFax: 123456789";
$string =~ m/Telef.n:\s+(\d+)\s+Fax:\s+(\d+)/
my ($phone,$fax) = ($1,$2);
This work for Perl 5.6.1 but fail for Perl 5.8. For Perl 5.8 I must write
regexp as
$string =~ m/Telef.+?n:\s+(\d+)\s+Fax:\s+(\d+)/
|
| Show full article (0.89Kb) |
|
no comments
|
|
|
|
|
|
|