Thread WWW::Scripter und Javascript: download der scripte (0 answers)
Opened by esskar at 2010-08-27 15:05

esskar
 2010-08-27 15:05
#140990 #140990
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
Hallo,

ich versuch das "DR UNIVERSE" von http://www.adr.com/BrokerInvestor/drsearch.aspx runter zu laden - per script.

bekomm leider den Fehler "ReferenceError: The variable WebForm_PostBackOptions has not been declared at line 1." wenn ich das entsprechende javascript evaluiere.

WebForm_PostBackOptions ist irgendwo in den includierten scripts definiert. tut WWW::Scripter die automatisch laden, oder muss ich das selber tun?

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/perl

BEGIN { use FindBin; use lib "$FindBin::Bin/lib" }

use strict;
use warnings;

use LWP::Debug qw(+);
use WWW::Scripter;

my $w = WWW::Scripter->new();
$w->use_plugin('JavaScript');

$w->get('http://www.adr.com');
$w->submit_form(
    form_name => 'agreementForm',
    button    => 'agreementAcceptButton',
);
die unless $w->success;
$w->get('/BrokerInvestor/drsearch.aspx ');
die unless $w->success;

my @buttons =
  $w->document->getElementsByClassName('ButtonClass Client DownloadUni');
my $onclick = $buttons[0]->getAttribute('onclick');
$w->get($onclick);

#$w->submit_form(
#       form_name => 'aspnetForm',
#       button => $buttons[0]->getAttribute('name')
#);

die unless $w->success;

View full thread WWW::Scripter und Javascript: download der scripte