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
#!d:\perl\bin\perl.exe -w
use CGI qw(:standard);
use CGI::Carp 'fatalsToBrowser';
use HTTP::Request::Common;
use HTTP::Cookies;
use HTTP::Headers;
use LWP;
use WWW::Mechanize;
print "Content-type: html; charset=UTF-8\n\n" ;
$proxy = 'http://localhost:5865';
$Skript = "http:\/\/$ENV{SERVER_NAME}$ENV{SCRIPT_NAME}";
$Server = "http:\/\/$ENV{SERVER_NAME}";
my $browser = WWW::Mechanize->new();
$browser->agent('Mozilla/5.0');
$browser->proxy(['https', 'http', 'ftp'], $proxy);
$ENV{HTTPS_PROXY} = $proxy;
$cookie_jar = new HTTP::Cookies();
$browser->cookie_jar($cookie_jar); #
$browser->agent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 2.0.50727)');
$browser->timeout(1200);
$browser->get("http://211.157.104.77:8080/sipo_EN/search/tabSearch.do?method=init"); #laedt Seitequelltext herunter
$page = $browser -> content;
$jplatpatSession="";
if($page =~ /(jsessionid=[A-Z0-9]*)\">/si){$jplatpatSession = $1}
$base = "http://211.157.104.77:8080/sipo_EN/search/tabSearch.do;";
$browser->post($base.$jplatpatSession);
$browser->form_number(1);
$browser->field("a", "103085931");
$browser->click(); #macht nichts? absenden?
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
43
44
45
46
47
48
#bis hierhin wie oben
use URI::Escape;
$browser->get("http://211.157.104.77:8080/sipo_EN/search/tabSearch.do?method=init"); #laedt Seitequelltext herunter
$page = $browser -> content;
$jsessionID="";
if($page =~ /(jsessionid=[A-Z0-9]*)\">/si){$jsessionID = $1}
$request_params_0 = ''.
'method=search&'.
'sortfiled=PublicationNumber&'.
'sorttype=+&'.
'dbfm=on&'.
'dbxx=on&'.
'a=103085931"'.
'b=&'.
'c=&'.
'd=&'.
'e=&'.
'f=&'.
'g=&'.
'h=&'.
'i=&'.
'j=&'.
'k=&'.
'l=&'.
'm=&'.
'logicExp=';
$request_params = uri_escape($request_params_0); #nötig?
$base = "http://211.157.104.77:8080/sipo_EN/search/tabSearch.do;";
$request = HTTP::Request->new('POST',$base);
$request->header('Content-Type' => 'application/x-www-form-urlencoded');
$request->header('Content-Length' =>'114');
$request->header('Transfer-Encoding'=>'chunked');
$request->header('Referer' => 'http://211.157.104.77:8080/sipo_EN/search/tabSearch.do?method=init');
$request->header('Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8');
#$request->header('Accept-Language'=>'de,en-US;q=0.7,en;q=0.3');
$request->header('Accept-encoding' => 'gzip, deflate');
$request->header('Connection' => 'keep-alive');
$request->header('Cookie' => 'JSESSIONID='.$jsessionID); #richtig so?
$request->content($request_params);
$response = $browser->request($request); #Zeile wirft einen Fehler
$page = $response->decoded_content();
print $page;
QuoteError POSTing http://211.157.104.77:8080/sipo_EN/search/tabSearc... Server closed connection without sending any data back at
QuoteBeachte dass Parameter sowohl an den URL gehängt werden als auch im Messagebody
1
2
3
$request_params = uri_escape($request_params_0);
$base = "http://211.157.104.77:8080/sipo_EN/search/tabSearch.do;";
$request = HTTP::Request->new('POST',$base.$request_params);
QuoteContent-Length header value was wrong, fixed at line 207
Error POSTing http://211.157.104.77:8080/sipo_EN/search/tabSearc... Server closed connection without sending any data back at
2017-05-09T07:54:11 rostiDer Content-Length Header darf nicht die Anzahl der Zeichen liefern sondern die Anzahl der Bytes.
QuoteAntwortkopfzeilen (0,569 KB):undefined
Anfragekopfzeilen (0,486 KB):undefined
Anfragekopfzeilen von abgehender Verbindung (0,064 KB):undefined
Content-Length:"114"
$request->header('Content-Length' =>'569'); #versucht mit 486, 64, 114, 8
QuoteError POSTing http://211.157.104.77:8080/sipo_EN/search/tabSearc... Server closed connection without sending any data back at line 70