Web scraping: Difference between revisions

Content added Content deleted
m (→‎Robust: FIx unnecessary use of quasiliteral to ordinary string literal.)
Line 992: Line 992:
end
end
isa(s, Requests.Response) || return (s, false)
isa(s, Requests.Response) || return (s, false)
t = match(r"<BR>(.*UTC)", s.data)
t = match(r"<BR>(.*UTC)", readall(s))
isa(t, RegexMatch) || return (@sprintf("raw html:\n %s", s.data), false)
isa(t, RegexMatch) || return (@sprintf("raw html:\n %s", readall(s)), false)
return (t.captures[1], true)
return (t.match[1], true)
end
end