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.

FPUS43 KLSX 272043
City Forecast for Columbia, MO 
Issued Friday afternoon - Feb 27, 2004

Friday night
 Low 35, 0% chance of precipitation.

Saturday
 Partly cloudy, high 62, 5% chance of precipitation.

Saturday night
 Low 42, 5% chance of precipitation.

Sunday
 Mostly cloudy, high 60.

Sunday night
 Low 45.

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.

FPUS43 KLSX 272043 City Forecast for Columbia, MO Issued Friday afternoon - Feb 27, 2004 Friday night Low 35, 0% chance of precipitation. Saturday Partly cloudy, high 62, 5% chance of precipitation. Saturday night Low 42, 5% chance of precipitation. Sunday Mostly cloudy, high 60. Sunday night Low 45.

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.

FPUS43 KLSX 272043 City Forecast for Columbia, MO Issued Friday afternoon - Feb 27, 2004 Friday night Low 35, 0% chance of precipitation. Saturday Partly cloudy, high 62, 5% chance of precipitation. Saturday night Low 42, 5% chance of precipitation. Sunday Mostly cloudy, high 60. Sunday night Low 45.