Anonymous user
Web scraping: Difference between revisions
→{{header|8th}}
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: need to match on content) |
|||
Line 39:
=={{header|8th}}==
<lang forth>\ Web-scrape sample: get UTC time from the US Naval Observatory:
<lang forth>( "http://tycho.usno.navy.mil/cgi-bin/timer.pl" net:get ▼
: read-url \ -- s
>s ▼
not if "Could not connect" throw then
/<BR>.*?(\d{2}:\d{2}:\d{2})\sUTC/ ▼
r:match ▼
: get-time
read-url
1 r:@ ▼
get-time bye
▲bye</lang>
{{output}}
<pre>14:08:20</pre>
|