in reply to modifyed http page in browser
Problem:#!/usr/bin/perl -w use WWW::Mechanize; use Win32::Process; use LWP; use strict; my $url="http://thewebside"; my $page; my $inhalt; my $firefoxpfad="C:\\firefox\\firefox.exe"; my $firefox="firefox"; ##### page holen ############################# $page = WWW::Mechanize->new( autocheck => 1 ); #$page = WWW::Mechanize->new(); $page->get($url); $page->success or die "Can't get the searched page"; #$page->form_name( "contactForm1" ); $page->form_number( 1 ); $page->field('contactFormId' => "1"); ### hidden field, is already s +et $page->field('name' => "myname"); $page->field('message' => "Hello"); ##### page speichern ######################## $inhalt = $page->content; ## normally I would like to open firefox with $inhalt which should ## contain already the filled fields ## but here I save it to disk #print $inhalt; open (ERGEBNISFILE, ">ergebnisfile.html") || die "Kann \"ergebnisfile\ +" nicht oeffnen $!"; printf ERGEBNISFILE "%s\n" ,"$inhalt"; close (ERGEBNISFILE); =BEGIN ##### open in browser ##################### Win32::Process::Create( my $ProcessObj, ### win xp "$firefoxpfad", "$firefox $url", 0, NORMAL_PRIORITY_CLASS, ".") || die ErrorRepor +t(); =END =cut
opens only with IE, I'd like to use firefox instead. If I try to open the real webside it starts loading with IE but then breaks.display("<html><body><h1>Hello world!</h1></body></html>");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: modifyed http page in browser
by Corion (Patriarch) on Apr 10, 2009 at 10:09 UTC |