tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shiby Maria John" <Shi...@ibsplc.com>
Subject Re: scrape
Date Mon, 26 Dec 2005 04:28:51 GMT

It was a simple example that was in the taglib distribution.
Here it is ::
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<%@ taglib uri="http://jakarta.apache.org/taglibs/scrape-1.0" prefix=
"scrp" %>
     <head>
        <title>Example JSP using scrape taglib</title>
     </head>
     <body bgcolor="#FFFFFF">
        <scrp:page url=
"http://weather.noaa.gov/cgi-bin/fmtbltn.pl?file=forecasts/city/mo/columbia.txt"

time="11">
            <scrp:scrape id="weather1" begin="<PRE>" end="</PRE>"
anchors="true"/>
            <scrp:scrape id="weather2" begin="<PRE>" end="</PRE>"
anchors="false"/>
            <scrp:scrape id="weather3" begin="<PRE>" end="</PRE>"
anchors="false" strip="true"/>
            </scrp:page>

        <h3 align="center">Weather Quote</h3><br/><br/>

        <p><b>Example #1</b><br/>
          The example below scrapes the page for the
          <a href=
"http://weather.noaa.gov/cgi-bin/fmtbltn.pl?file=forecasts/city/mo/columbia.txt"
>Columbia,
          Missouri weather forecast</a> from the <a href=
"http://weather.noaa.gov/">National Weather Service</a> site. In this
scrape, the
          <b>anchors</b> attribute was set to true, and the <b>begin</
b> and <b>end</b> anchor attributes
          were set to the &lt;PRE> and &lt;/PRE> tags that surround
the forecast.
        </p>

        <scrp:result scrape="weather1"/>

        <hr/>
        <p><b>Example #2</b><br/>
          This example scrapes the same page as the first example and
uses the same anchors,
          but in this case the <b>anchors</b> attribute was set to
false so that the anchors are stripped from
          the scrape result. Browsers typically treat text within &lt;
PRE> tags with a monospaced font
          and line breaks in the HTML are retained. Since the &lt;PRE>
and &lt;/PRE> tags are the anchors and they
          are removed from the scrape result, the formatting is
noticeably different.
        </p>

        <scrp:result scrape="weather2"/>

        <hr/>
        <p><b>Example #3</b><br/>
          This example scrapes the same page as the first two examples
and uses the same anchors,
          but in this case the <b>anchors</b> attribute was set to
false and the <b>strip</b> attribute was set to true so that the
anchors and HTML tags are stripped from the scrape result.
        </p>

        <scrp:result scrape="weather3"/>
     </body>
</html>

And the output is
                            Weather Quote




Example #1
The example below scrapes the page for the Columbia, Missouri weather
forecast from the National Weather Service site. In this scrape, the
anchors attribute was set to true, and the begin and end anchor
attributes were set to the <PRE> and </PRE> tags that surround the
forecast.





Example #2
This example scrapes the same page as the first example and uses the
same anchors, but in this case the anchors attribute was set to false
so that the anchors are stripped from the scrape result. Browsers
typically treat text within <PRE> tags with a monospaced font and line
breaks in the HTML are retained. Since the <PRE> and </PRE> tags are
the anchors and they are removed from the scrape result, the
formatting is noticeably different.





Example #3
This example scrapes the same page as the first two examples and uses
the same anchors, but in this case the anchors attribute was set to
false and the strip attribute was set to true so that the anchors and
HTML tags are stripped from the scrape result.



                                                                                         
                                             
                      Rahul Akolkar                                                      
                                             
                      <rahul.akolkar@gm        To:       Tag Libraries Users List <taglibs-user@jakarta.apache.org>
                   
                      ail.com>                 cc:                                    
                                                
                                               Subject:  Re: scrape                      
                                             
                      12/22/2005 06:49                                                   
                                             
                      PM                                                                 
                                             
                      Please respond to                                                  
                                             
                      "Tag Libraries                                                     
                                             
                      Users List"                                                        
                                             
                                                                                         
                                             
                                                                                         
                                             




On 12/22/05, Shiby Maria John <ShibyM@ibsplc.com> wrote:
> Hi,
>
> I have been trying to use the scrape taglib for my application.
>  BUt nothing comes in the output page.
>
> What may be the reason for this??
>
<snip/>

We will probably need some more details. If you can post the simplest
example that doesn't work (and why you think it should work if that
isn't obvious), your environment details etc. someone on the list may
be able to help.

-Rahul

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org









---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message