Schrift
[thread]10564[/thread]

Forum abschicken mit WWW::Mechanize (Seite 4)

Leser: 4


<< |< 1 2 3 4 >| >> 35 Einträge, 4 Seiten
nepos
 2007-10-12 19:44
#100774 #100774
User since
2005-08-17
1420 Artikel
BenutzerIn
[Homepage] [default_avatar]
Und was kommt da als Ausgabe?
jogi
 2007-10-12 19:56
#100775 #100775
User since
2007-07-25
55 Artikel
BenutzerIn
[default_avatar]
Geht doch...hmm.

Quote
E:\perl>perl check.pl
Trying to connect to '196.20.65.210:8080' and retrieve 'http://www.microsoft.com/
'
'196.20.65.210:8080' returns:

HTTP/1.1 504 Proxy Timeout ( DÚlai de connexion dÚpassÚ. Pour plus d'informatio
ns sur cet ÚvÚnement, consultez l'aide de ISA Server. )

Trying to connect to '200.80.227.184:8080' and retrieve 'http://www.microsoft.co/
m'
'200.80.227.184:8080' returns:

HTTP/1.1 502 Proxy Error ( The ISA Server denied the specified Uniform Resource
Locator (URL). )

Trying to connect to '200.83.4.60:80' and retrieve 'http://www.microsoft.com/'
'200.83.4.60:80' returns:

HTTP/1.1 302 Found

Trying to connect to '208.48.253.137:80' and retrieve 'http://www.microsoft.com/'

'208.48.253.137:80' returns:

HTTP/1.1 302 Found

Trying to connect to '208.122.34.234:80' and retrieve 'http://www.microsoft.com/'

'208.122.34.234:80' returns:

HTTP/1.1 302 Found

Trying to connect to '122.252.229.12:80' and retrieve 'http://www.microsoft.com/'

'122.252.229.12:80' returns:

HTTP/1.1 302 Found

Trying to connect to '212.11.191.67:80' and retrieve 'http://www.microsoft.com/'
'212.11.191.67:80' returns:

HTTP/1.1 302 Found

Trying to connect to '59.151.53.106:80' and retrieve 'http://www.microsoft.com/'
'59.151.53.106:80' returns:

HTTP/1.1 403 Forbidden

Trying to connect to '70.87.7.56:80' and retrieve 'http://www.microsoft.com/'
'70.87.7.56:80' returns:

HTTP/1.1 400 Bad Request

Trying to connect to '74.231.24.11:80' and retrieve 'http://www.microsoft.com/'
'74.231.24.11:80' returns:

HTTP/1.0 400 Bad request: request-line invalid

Trying to connect to '85.214.126.154:80' and retrieve 'http://www.microsoft.com/'

Terminating on signal SIGINT(2)
jogi
 2007-10-12 22:00
#100779 #100779
User since
2007-07-25
55 Artikel
BenutzerIn
[default_avatar]
Bei fast jedem Proxy gibt warn $mech->content; eine Fehlermeldung vom Proxy aus.

Paar Beispiele:

Quote
Beginn
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><TITLE>SCM&reg; appliance CMSDMailGateway.colum
bus.k12.ms.us reports illegal proxy request</TITLE></head><body><h1>400 - Bad Request</h1><hr><table border=0 width=100%
cellpadding=2><tr><td width=175 valign=top align=left><img hspace=6 border=0 alt="SCM&reg; appliance Logo" src="http:///
10.101.16.2:80/http://-internal-/00137253b9ef/webshield.jpg"></td><td valign=top align=left><h2>SCM<sup>&reg;</sup> appl
iance CMSDMailGateway.columbus.k12.ms.us reports illegal proxy request<br></h2><br><h3>The requested URL does not contai
n a path</h3><br><h3>URL: http://www.microsoft.com/</h3></td></tr></table><hr><h6><p><p>Copyright &copy; 1993-2007 McAfee
, Inc.<br>All Rights Reserved.<br> <a href="http://www.mcafee.com/">http://www.mcafee.com/</a></p></p></h6></body> at mech
anize_neu.pl line 23, <FILE> line 1.
Ende


Quote
Beginn
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access http://www.microsoft.com/
on this server.</p>
</body></html>
Ende


Quote
Beginn
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /
on this server.</p>
</body></html>
Ende


Wenn ich die selbe Webseite mit dem Browser aufrufe erscheint keine Fehlermeldung.

Woran liegt das bitte?

jogi
 2007-10-13 19:13
#100784 #100784
User since
2007-07-25
55 Artikel
BenutzerIn
[default_avatar]
Kann mir hier wirklich niemand weiterhelfen?

Ich habe hier eine Liste mit Proxies die alle HTTP/1.1 200 OK geantwortet haben.

83.236.135.140:80
70.87.7.56:80
68.153.118.157:80
65.196.51.21:80
222.221.6.144:808
221.4.151.150:808
221.10.53.43:8080
212.71.30.162:80
208.122.34.234:80
208.109.123.121:80
203.180.79.141:8080
202.64.220.99:8080
202.115.130.23:8080
201.147.199.205:80
195.76.242.227:80
192.115.104.88:80

Und hier ein Skript, mit dem ich die Proxies testen möchte.

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
34
35
36
37
38
39
40
41
42
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;

open (FILE, "<ok.txt") or die $!;
while (my $proxy = <FILE>) {

    my $mech = WWW::Mechanize->new;

    #$mech->timeout(10);

    $mech->add_header( 'accept-language' => 'de') or die();

    $mech->proxy(['http', 'ftp'], "http://$proxy/") or die();

        print "Trying to retreive URL trough proxy $proxy\n";

    $mech->get("http://www.rapidshare.com/files/47486343/PowerOptions.pdf") or die();

    #warn $mech->content;

    $mech->click_button( number => '2' ) die ();

    print "Button geklickt\n";

    my $content = $mech->content;

    if ( $content =~ /\(\w+\s\w+\s(.*)\s\w+\)/i ) {
        print "warte $1 Minuten.\n";
    }
    elsif ( $content =~ /Kein Premium-User/i ) {
        print "Kein Premium-User.\n";
    }
    elsif ( $content =~ /Zu viele Benutzer laden gerade Dateien runter./i ) {
        print "Zu viele Benutzer laden gerade Dateien runter.\n";
    }
    elsif ( $content =~ /Du musst warten, bis der Download fertig ist./i ) {
        print "Du musst warten, bis der Download fertig ist.\n";
    }
    else { print "Unknown error"; }
}


Mit dem Programm möchte ich eine Seite aufrufen und dort einen Button klicken.

Quote
E:\perl>perl mechanize_neu.pl
Trying to retreive URL trough proxy 83.236.135.140:80

Button geklickt
warte 285 Minuten.
Trying to retreive URL trough proxy 70.87.7.56:80

Button geklickt
Unknown errorTrying to retreive URL trough proxy 68.153.118.157:80

Button geklickt
Kein Premium-User.
Trying to retreive URL trough proxy 65.196.51.21:80

Can't call method "find_input" on an undefined value at C:/Perl/site/lib/WWW/Mechanize.pm line 1586, <FILE> li
ne 4.


Manchmal kommt es dann zu dem Fehler in der letzten Zeile. Kann mir hierauf wirklich niemand eine Antwort geben. Ich probiere hier schon stundenlang herum und kriegs einfach nicht hin.

jogi
jogi
 2007-10-14 15:04
#100794 #100794
User since
2007-07-25
55 Artikel
BenutzerIn
[default_avatar]
Hier habe ich einmal einen Proxy 5 mal hintereinander getestet. Das kam dabei raus:

Quote
E:\perl>perl mech.pl
Trying to retreive URL trough proxy 89.32.161.8:3128
Kein Premium-User.


E:\perl>perl mech.pl
Trying to retreive URL trough proxy 89.32.161.8:3128
Can't call method "find_input" on an undefined value at C:/Perl/site/lib/WWW/Mechanize.pm line 1586.

E:\perl>perl mech.pl
Trying to retreive URL trough proxy 89.32.161.8:3128
Unknown error


E:\perl>perl mech.pl
Trying to retreive URL trough proxy 89.32.161.8:3128
Unknown error


E:\perl>perl mech.pl
Trying to retreive URL trough proxy 89.32.161.8:3128
Kein Premium-User.



Getestet hiermit habe ich den Proxy hiermit:

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
34
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;

my $proxy = "89.32.161.8:3128";

my $mech = WWW::Mechanize->new;

$mech->add_header( 'accept-language' => 'de') or die();

$mech->proxy(['http', 'ftp'], "http://$proxy/") or die();

print "Trying to retreive URL trough proxy $proxy\n";

$mech->get("http://www.rapidshare.com/files/47486343/PowerOptions.pdf") or die();

$mech->click_button( number => '2' ) or die ();

my $content = $mech->content or print "Scheiße";

if ( $content =~ /\(\w+\s\w+\s(.*)\s\w+\)/i ) {
        print "warte $1 Minuten.\n\n";
}
elsif ( $content =~ /Kein Premium-User/i ) {
        print "Kein Premium-User.\n\n";
}
elsif ( $content =~ /Zu viele Benutzer laden gerade Dateien runter./i ) {
        print "Zu viele Benutzer laden gerade Dateien runter.\n\n";
}
elsif ( $content =~ /Du musst warten, bis der Download fertig ist./i ) {
        print "Du musst warten, bis der Download fertig ist.\n\n";
}
else { print "Unknown error\n\n"; }


Bitte, bitte, bitte. Irgendwer muss mir hierbei doch helfen können.

jogi

----
Modedit Gwendragon:
+Perl-Tag; Bitte Code in Perl- oder Code-Tags!
----
<< |< 1 2 3 4 >| >> 35 Einträge, 4 Seiten



View all threads created 2007-10-11 21:33.