(notonline)-->
--
-- demo\rosetta\web_scrape.exw
-- ===========================
--
without js -- (libcurl)
include builtins\libcurl.e
include builtins\timedate.e
object res = curl_easy_perform_ex("https://rosettacode.org/wiki/Talk:Web_scraping")
if string(res) then
res = split(res,'\n')
for i=1 to length(res) do
if not match(`<div id="siteNotice">`,res[i]) then -- (24/11/22, exclude notice)
integer k = match("UTC",res[i])
if k then
string line = res[i] -- (debug aid)
res = line[1..k-3]
k = rmatch("</a>",res)
res = trim(res[k+5..$])
exit
end if
end if
end for
?res
if string(res) then
timedate td = parse_date_string(res, {"hh:mm, d Mmmm yyyy"})
?format_timedate(td,"Dddd Mmmm ddth yyyy h:mpm")
end if
else
?{"some error",res,curl_easy_strerror(res)}
end if