Hi Ralph. With the page open in Chrome, I inspect the HTML with F12,
clicking on the triangle to step down the tree.
I see that I am using requests/get, but I pretty-printed my output
which, apart from line feeds, is the same as your email. I certainly see
no ==$0!
Maybe I'll have to relearn BS! I'll have another go.
Thanks, Graeme
On 13/05/2026 14:41, Ralph Corderoy wrote:
Hi Graeme,
https://weather.metoffice.gov.uk/specialist-forecasts/coast-and-sea/inshore-waters-forecast
Look particularly in area-labelledby area7
class="card-content"
class=forecast-block"
etc.
Looking at the HTML, as soon as you click on a lower level tag,
the == $0 disappears
I'm not sure what clicking you mean, but the <section> for 'area7' looks
filled out in the HTML returned by the web server to me.
$ curl -sSg
https://weather.metoffice.gov.uk/specialist-forecasts/coast-and-sea/inshore-waters-forecast
|
sed -rn '/labelledby.*\<area7\>/,/<\/section>/p'
<section aria-labelledby="area7" id="inshore-waters-7" class="marine-card warning"
data-value="inshore-waters-7">
<h2 id="area7" class="card-name">Selsey Bill to Lyme Regis (7)</h2>
<div class="card-content">
<p>Strong winds are forecast</p>
<div class="forecast-block">
<h3>24 hour forecast:</h3>
<div class="forecast-info">
<dl>
<dt>Wind</dt>
<dd>West veering northwest 5 or 6, occasionally 7 at first, then decreasing 4 at
times later.</dd>
<dt>Sea state</dt>
<dd>Slight or moderate.</dd>
<dt>Weather</dt>
<dd>Showers, thundery at first.</dd>
<dt>Visibility</dt>
<dd>Good, occasionally poor at first.</dd>
</dl>
</div>
</div>
<div class="outlook-block">
<h3>Outlook for the following 24 hours:</h3>
<div class="forecast-info">
<dl>
<dt>Wind</dt>
<dd>North or northwest 3 to 5.</dd>
<dt>Sea state</dt>
<dd>Slight, occasionally smooth later.</dd>
<dt>Weather</dt>
<dd>Showers, thundery at first.</dd>
<dt>Visibility</dt>
<dd>Good, occasionally poor at first.</dd>
</dl>
</div>
</div>
</div>
</section>
$
--
Next meeting: Online, Jitsi, Tuesday, 2026-06-02 20:00
Check to whom you are replying
Meetings, mailing list, IRC, ... https://dorset.lug.org.uk
New thread, don't hijack: mailto:[email protected]