Web scraping: Difference between revisions
Content added Content deleted
SqrtNegInf (talk | contribs) m (→{{header|Perl 6}}: need to match on content) |
|||
Line 39: | Line 39: | ||
=={{header|8th}}== |
=={{header|8th}}== |
||
<lang forth>\ Web-scrape sample: get UTC time from the US Naval Observatory: |
|||
⚫ | |||
: read-url \ -- s |
|||
if |
|||
⚫ | |||
⚫ | |||
not if "Could not connect" throw then |
|||
⚫ | |||
⚫ | |||
tuck |
|||
⚫ | |||
: get-time |
|||
if |
|||
read-url |
|||
⚫ | |||
⚫ | |||
nip |
|||
⚫ | |||
. cr |
|||
⚫ | |||
then ; |
|||
else |
|||
"Cannot connect. Error " . . cr |
|||
get-time bye |
|||
then |
|||
⚫ | |||
) w:exec |
|||
⚫ | |||
{{output}} |
{{output}} |
||
<pre>14:08:20</pre> |
<pre>14:08:20</pre> |