Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by saorge (6224) on 2006.08.02 2:25 (#49142)
    Maybe HTML::HTMLDoc can help you !
    • Thanks. I tested PDF::FromHTML as well and i guess these use the same idea behind. What I really want is to display HTML using real browser engines like IE/Firefox/Safari.

      Thanks for your info anyway.
      • Something like this, you mean?

        use Mac::Glue;
        use Mac::InternetConfig; # GetICHelper
        use Mac::MoreFiles; # %Application
         
        my($id) = GetICHelper('http');
        my $app_path  = $Application{$id};  # or define path yourself ... this could potentially fail
        my $file_path = '/Users/pudge/Desktop/a.html';
         
        my $finder = new Mac::Glue 'Finder';
         
        my $file = $finder->obj(file => $file_path);
        my $app  = $finder->obj(file => $app_path);
         
        $file->open(using => $app);

        • Thanks! Yeah, this is very close, except you code doesn't look like actually "printing" the HTML document. I'd like to automate the print process as well. Thanks for your code anyway. It's pretty helpful.
          • Aha. Well, let's simplify by assuming Safari, then. Try:
            use Mac::Glue;
             
            my $file_url = 'file://localhost/Users/pudge/Desktop/a.html';
            my $safari = new Mac::Glue 'Safari';
             
            my $doc = $safari->make(new => 'document');
            $doc->prop('url')->set(to => $file_url);
            $doc->print;
          • WWW::Selenium might be what you want. Cross-platform too. Right now the interface is a bit rough, but I'm working on making it easier to use with Test::WWW::Selenium::Catalyst.