[32338] in Perl-Users-Digest
Perl-Users Digest, Issue: 3605 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Feb 4 06:09:21 2012
Date: Sat, 4 Feb 2012 03:09:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 4 Feb 2012 Volume: 11 Number: 3605
Today's topics:
purge old build files <wpmccormick@just_about_everywhere.com>
WWW::Mechanize and outputing what's returned <justin.1201@purestblue.com>
Re: WWW::Mechanize and outputing what's returned <ben@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 03 Feb 2012 11:11:19 -0600
From: Bill M <wpmccormick@just_about_everywhere.com>
Subject: purge old build files
Message-Id: <jgh4fp$7o0$1@dont-email.me>
What is the proper way to purge/delete/remove cpan and cpanm build and
work dirs?
I tried the cpan clean command at the cpan command prompt but it seemed
to not do anything.
There most be some reliable way to do this?
Thanks!!
------------------------------
Date: Fri, 3 Feb 2012 13:49:03 +0000
From: Justin C <justin.1201@purestblue.com>
Subject: WWW::Mechanize and outputing what's returned
Message-Id: <f75tv8-7gc.ln1@zem.masonsmusic.co.uk>
I've just written my first WWW::Mechanize program, it does it's job,
and I can export the data to PDF using PDF::FromHTML. What I don't get
with this, however, are the images on the page, so my PDF is ugly.
I've tried using $mech->find_all_images(), and downloading them, but
the images on the page are all relative links - and, it seems, the
relative path is being set depending which style sheet is in force at
the time.
Can anyone suggest where I start reading so that I can learn how to
get the entire page, including images, and have the html in
$mech->content display links to the locally downloaded copies of the
images?
Or is there a better way to submit a form and get what is returned
into a PDF?
Thank you for any suggestions.
Justin.
--
Justin C, by the sea.
------------------------------
Date: Fri, 3 Feb 2012 16:30:34 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: WWW::Mechanize and outputing what's returned
Message-Id: <ametv8-4tp2.ln1@anubis.morrow.me.uk>
Quoth Justin C <justin.1201@purestblue.com>:
> I've just written my first WWW::Mechanize program, it does it's job,
> and I can export the data to PDF using PDF::FromHTML. What I don't get
> with this, however, are the images on the page, so my PDF is ugly.
Also, that module makes no attempt to handle CSS, so for most ordinary
web pages it's probably useless.
> I've tried using $mech->find_all_images(), and downloading them, but
> the images on the page are all relative links - and, it seems, the
> relative path is being set depending which style sheet is in force at
> the time.
I'm not sure what you mean here. ->find_all_images returns
WWW::Mech::Image objects, which have both ->url and ->base methods. Is
that not enough to download the image and put it in the right place in a
tree?
> Can anyone suggest where I start reading so that I can learn how to
> get the entire page, including images, and have the html in
> $mech->content display links to the locally downloaded copies of the
> images?
>
> Or is there a better way to submit a form and get what is returned
> into a PDF?
Rendering modern HTML is an extremely complicated business. I wouldn't
try to to it in pure Perl unless there's no other option. For rendering
to PDF I'd look at PDF::WebKit, which uses an external WebKit-based
binary to do the rendering; unfortunately it also requires Qt, which may
mean you can't use it.
If you are having trouble because you're feeding WebKit HTML from Mech
and it can't resolve the URLs, you probably want to use the base_href
parameter to Mech->content.
Ben
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 3605
***************************************