Re: RE: LWP get only <center> img


----- Original Message -----
From: Brian Volk <BVolk@HPProducts.com>
Date: Thursday, December 23, 2004 8:55 am
Subject: RE: LWP get only <center> img

> Mark, 
> 
> Thank you so much for your help, that worked great!  It turns out 
> that I
> already had the latest version of HTML::Tokeparser::Simple installed.

NP Bryon, that is what this list is all about. I am sure next time you'll try to give me a hand.

Happy Holiday's All...Cheers
Mark G.
> 
> Thanks again!
> 
> Brian 
> 
> > -----Original Message-----
> > From: mgoland@optonline.net [mgoland@optonline.net]
> > Sent: Thursday, December 23, 2004 1:22 AM
> > To: Brian Volk
> > Cc: Beginners (E-mail)
> > Subject: Re: LWP get only <center> img
> > 
> > 
> > 
> > 
> > 
> > ----- Original Message -----
> > From: Brian Volk <BVolk@HPProducts.com>
> > Date: Wednesday, December 22, 2004 12:59 pm
> > Subject: LWP get only <center> img
> > 
> > > Hi All, 
> > 
> > Hello
> > > 
> > > I have a list of url source files... I need to get a certain 
> "<img 
> > > src="from each file.  The one thing that separates it from the 
> > > other <img src
> > > tags is it is preceded by <center> for example: <center><img
> > > src="/rcp/ObjectServer?table=Images&id=381" but the sequence 
> of 
> > > img tags is
> > > different in each of the files.  Is there a way to get the img 
> > > 'src' tag if
> > > the img tag is eq to <center>?  Maybe I could write a regex to 
> do 
> > > this?pointers? 
> > The module you are trying to use already has everything you 
> > need for the task.
> > > 
> > > I've broken my script down to try and get the <center> <img 
> scr= 
> > > from just
> > > one source file.
> > > 
> > > Below is one attempt where I thought I was getting close ...  
> > > maybe not...
> > > :~).  Any suggestions would be greatly appreciated. 
> > 
> > You are real close, you need to use a few other functions 
> > from the module.
> > > 
> > > 
> > > 
> > > #!/usr/bin/perl 
> > > 
> > > use strict;
> > > use warnings;
> > > use HTML::TokeParser::Simple;
> > > use LWP::Simple;
> > > 
> > > my $url = "
> > > http://www.rcpworksmarter.com/rcp/products/detail.jsp?rcpNum=1013
> > > 
> > 
> <http://www.rcpworksmarter.com/rcp/products/detail.jsp?rcpNum=1013> ";
> > > my $page = get($url) 
> > >  or die "Could not load URL\n";
> > You can avoid all of that if you download the latest release 
> > of HTML::TokeParser::Simple from CPAN.
> > 
> > > 
> > > my $parser = HTML::TokeParser::Simple->new(\$page) 
> > >  or die "Could not parse page";
> > > 
> > > $parser->get_tag ("img") || die;
> > > my $token = $parser->get_token;
> > > if ($token->[0] eq "center"); 
> > > print;
> > > 
> > > # ---end ---
> > 
> > Here is one way to do it. It's not a compleate deal, but will 
> > work for the test page you have supplied and as a learning base. 
> > 
> > #!/usr/bin/perl 
> >  
> >  use strict;
> >  use warnings;
> >  use HTML::TokeParser::Simple;
> > 
> >  
> >  my $url = 
> 'http://www.rcpworksmarter.com/rcp/products/detail.jsp?rcpNum=1013';
> 
> my $parser = HTML::TokeParser::Simple->new(url => $url) or die 
> "Could not
> parse page";
> 
> 
> 
> while ( my $token = $parser->get_token ) {
> 
> 
>  if ( $token->is_start_tag( 'center' ) ) {
> 	my $TAG = $parser->get_token();
> 	print $TAG->get_attr('src');
>   }
> 
> }
> 
> HTH,
> Mark G.
> 
> P.S. How about a free garbige bin for getting you on the way :O)
> 
> > 
> > 
> > Brian Volk
> > HP Products
> > 317.298.9950 x1245
> > <bvolk@hpproducts.com> bvolk@hpproducts.com
> > 
> > 
> >  
> 
> 
> -- 
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 
> -- 
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 

0
mgoland
12/23/2004 3:46:34 PM
perl.beginners 29388 articles. 4 followers. Follow

0 Replies
442 Views

Similar Articles

[PageSpeed] 8

Reply:

Similar Artilces:

LWP get only <center> img
------_=_NextPart_001_01C4E850.0A0C6010 Content-Type: text/plain; charset="iso-8859-1" Hi All, I have a list of url source files... I need to get a certain "<img src=" from each file. The one thing that separates it from the other <img src tags is it is preceded by <center> for example: <center><img src="/rcp/ObjectServer?table=Images&id=381" but the sequence of img tags is different in each of the files. Is there a way to get the img 'src' tag if the img tag is eq to <center>? Maybe I could write a regex t...

Q: re C<< -> >>
I hope not to raise too much the noise/signal level on list, but I have a question: I have had a long experience programming my HP28s pocket calculator, and its RPN language that AFAIK is mostly the same as that of newer models, supported constructs of the form -> a b << ... >> where C<< -> >> is a literal right arrow char and C<<< << >>> and C<<< >> >>> are literal guillemets (delimiting blocks). Just wonder wether by any chance *that* language has had any influence on the -> $x, $y { ... } ...

Re: Change "($one, $two)=" behavior for optimization? (was Re: RFC 175 (v1) Add C<list> keyword to force list context (like C<scalar>))
> Ever consider then having > > ($a, $b, $c) = <FH>; > or > @a[4,1,5] = <FH>; > > only read three lines? I think this is a superb idea, and look forward to someone's RFC'ing it. Damian At 11:48 AM 9/3/00 +1100, Damian Conway wrote: > > Ever consider then having > > > > ($a, $b, $c) = <FH>; > > or > > @a[4,1,5] = <FH>; > > > > only read three lines? > >I think this is a superb idea, and look forward to someone'...

Re: Virus Hoax Warning (Kaspersky
This was in newsfeedback, but I've posted here because I feel a bit embarassed about being in there since this is OT, below: "Joh@nnes" wrote: > > Good morning Charlie,just read it again...and this FILE is not ID > as Microsoft file<<<I am suspicious now>>>Would some_body confirm > me about this file???This is Windows\Command file!!!TIA. Is this hoax a joke? I enquired about this file sometime back (I think in Techtalk). If I go into Windows\Command and look at all the icons, they all look very *formal*. This Sulfnbk.exe has an i...

Re: Outlook will see non-existing attachments<<<SORRY>>>
Outlook will see non-existing attachments Feb, 14 2002 - 21:40 contributed by: hx Problem Outlook Interprets Carriage Returns (0x0d or <CR>) as Carriage Return/Line Feed combinations (0x0d 0x0a or <CRLF>) in Message Headers Versions affected Outlook Express 5.5 with Windows 95 and Outlook Express 6.0 on Windows 2000 confirmed; other versions of Outlook and Outlook Express are suspected. Outlook Express on Macintosh seems unaffected (tested version 5.02). No definite status on other MUA's here. I found no vulnerable versions, but as I did not do extensive testing,...

RE : RE : RE : RE : Regular expressions
Here is a sample of what your piece of code returns on my Aix box. 44520 -> /prog/gena/8.1.1/bin/dispatch 44650 -> reproject 45176 -> aioserver 45432 -> aioserver 45724 -> -ksh 46002 -> /bin/bsh 46232 -> /usr/dt/bin/dtterm 46584 -> /usr/bin/ksh 46820 -> /usr/dt/bin/ttsession 47060 -> /bin/bsh 47304 -> /usr/dt/bin/dtlogin 47396 -> /usr/dt/bin/dtterm 47722 -> dtfile 47942 -> /usr/dt/bin/dtsession 48272 -> dtfile 48568 -> ora_cjq0_gist 48758 -> gxtrackd 49032 -> dtwm 49330 -> /usr/lib/lpd/pio/etc/piohpnpf 49592 -> b...

Re: RFC 199 (v1) Short-circuiting C<grep> and C<map> with C<last>
Just to note that RFC 76 (Builtin: reduce) also proposes this mechanism as a means of short-circuiting C<reduce>. Damian ...

Re: Re: Olson <-> Microsoft mappings
Michael Fair <michael@daclubhouse.net> wrote: > For instance, "So what's the time in Ireland?" > Do you use "Europe/Dublin" or "Europe/Belfast"? What's the > difference? > Do you expect the end user to know that Dublin and Belfast are in > Ireland > before they can see the time in Ireland? This is a bit of a beef I have (as of earlier today) with the Olson project. I've managed to auto-map about 174 of the olson zones to geographic places but am scared I may have to do the rest by hand. I wish the names were mor...

[PATCH] re patch 33127: formatting for C<<{ bydepth => 1 }>>
------_=_NextPart_001_01C864E2.F98ABCBC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 33127=20was=20to=20correct=20"Formatting=20for=20C<<{=20bydepth=20=3D>=20= 1=20}>>=20doesn't=20seem=20to=20be=20working=20right=20in=20the=20manpage= "=0D=0A=0D=0AThe=20error=20with=20the=20bit=20of=20pod=20if=20that=20C<<= =20>>=20needs=20white=20space=20round=20the=20delimiters.=0D=0A=0D=0Aperl= pod.pod:=20...=20doubled=20angle=20brackets=20("<<"=20and=20">>")=20may= =2...

Re: Re:
Sorry about that, my mistake, the patched method goes like this: procedure DeallocateHWnd(Wnd: HWND); var Instance: Pointer; begin Instance := Pointer(GetWindowLong(Wnd, GWL_WNDPROC)); if Instance <> @DefWindowProc then begin { make sure we restore the default windows procedure before freeing memory } SetWindowLong(Wnd, GWL_WNDPROC, Longint(@DefWindowProc)); FreeObjectInstance(Instance); end; DestroyWindow(Wnd); end; "Andreas Hausladen" <AndreasDOTHausladen@gObviousToBeRemovedmx.de> wrote in message news:99620@f...

Thanks. Working! Re: Re: RE: RE: DBI->Connect returning UNDEF in cgi but not in standalone prog
--Next_1111523273---0-202.54.124.151-25290 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Guys,=0AIts working. Thanks all.=0Aspecial thanks to Reidy Ron and Bill Cos= ta.=0A=0AThe suggestion Ron gave was absolutely correct. There were a whole= lot of env variables different/missing between the 2 environments.=0A=0ATh= e one which finally made it work was=0A$ENV{'TNS_ADMIN'} =3D '/var/opt/orac= le/network/admin';=0A=0AThanks again,=0ASunil=0A =A0=0A=0A=0AOn Wed, 23 Mar= 2005 Sunil A.V. wrote :=0...

RE : RE : RE : RE : Regular expressions #2
No worries :-) It works now, thanks a lot :-) Best regards, Steve Hemond Programmeur Analyste / Analyst Programmer Smurfit-Stone, Ressources Foresti=E8res La Tuque, P.Q. Tel.: (819) 676-8100 X2833 shemond@smurfit.com=20 > -----Original Message----- > From: drieux [mailto:drieux@wetware.com]=20 > Sent: Wednesday, December 17, 2003 1:38 PM > To: Perl Perl > Subject: Re: RE : RE : RE : Regular expressions >=20 >=20 >=20 > On Dec 17, 2003, at 10:24 AM, drieux wrote: >=20 > > > > open(PS, "ps -efA|") or...

RE: Re: [wxperl-users] Re: Re: EVT_QUERY_END_SESSION
you putted the EVT_CLOSE to the wrong place... or do you have a reason why you need it to be there? $app ist not the window, but you could use EVT_CLOSE on $frame too. i changed your minimal sample that it works. hope it helps greeting Marco ---- use Wx; ########################### package MyApp; use strict; use vars qw(@ISA); @ISA=qw(Wx::App); sub OnInit { my( $this ) = @_; my( $frame ) = MyFrame->new( "Minimal wxPerl app", Wx::Point->new( 50, 50 ), Wx::Size->new( 450, 350 ) ); ...

RE: CGI.pm <html><TAGS>
David Gilden wrote: > Good afternoon, > a few quick questions pertaining to CGI.pm: > > How can I get CGI.pm to return lower case <html> tags. > > print end_html; # prints Upper Case </BODY></HTML> probably need to upgrade CGI.pm. I get lower case: $ perl -MCGI=:standard -le 'print $CGI::VERSION; print end_html' 2.752 </body></html> > > is there something I can add locally to my script or do I have to > send a request to my ISP? How would tell what version I have running > at my account? output $CGI:...

Web resources about - Re: RE: LWP get only <center> img - perl.beginners

Resources last updated: 12/24/2015 8:11:33 PM