Anonymous user
Web scraping: Difference between revisions
no edit summary
(Undo revision 259816 by AykayayCiti (talk)) |
No edit summary |
||
Line 26:
<TITLE>What time is it?</TITLE>
<H2> US Naval Observatory Master Clock Time</H2> <H3><PRE>
<BR>Jul. 27, 22:57:22 UTC
<BR>Jul. 27, 06:57:22 PM EDT
<BR>Jul. 27, 05:57:22 PM CDT
<BR>Jul. 27, 04:57:22 PM MDT
<BR>Jul. 27, 03:57:22 PM PDT
<BR>Jul. 27, 02:57:22 PM AKDT
<BR>Jul. 27, 12:57:22 PM HAST
...
Line 50:
: get-time
read-url
/<BR>.*?(\d{2}:\d{2}:\d{2})\sUTC/
tuck r:match if
1 r:@ . cr
Line 187:
<lang dos>
when ScrapeButton.Click do
when ScrapeWeb.GotText url,responseCode,responseType,responseContent do
</lang>
Line 340:
ClassMethod ExtractHTMLData(pHost As %String = "", pPath As %String = "", pRegEx As %String = "", Output list As %List) As %Status
{
}
}
}
}
}
}
Line 658:
begin
{ The line we're looking for is something like this:
<BR>May. 04. 21:55:19 UTC
// Check each line
Line 767:
main() ->
=={{header|F_Sharp|F#}}==
Line 966:
public class WebTime{
}
}</lang>
Line 1,003:
{{out}}
<lang sh>$ ./Web_scraping.jq
Apr. 21, 05:19:32 UTC
=={{header|Julia}}==
Line 1,096:
local(raw_htmlstring = '<TITLE>What time is it?</TITLE>
<H2> US Naval Observatory Master Clock Time</H2> <H3><PRE>
<BR>Jul. 27, 22:57:22 UTC
<BR>Jul. 27, 06:57:22 PM EDT
<BR>Jul. 27, 05:57:22 PM CDT
<BR>Jul. 27, 04:57:22 PM MDT
<BR>Jul. 27, 03:57:22 PM PDT
<BR>Jul. 27, 02:57:22 PM AKDT
<BR>Jul. 27, 12:57:22 PM HAST
</PRE></H3>
')
Line 1,111:
local(
)
Line 1,186:
tok = s(ix(k-1)+4:ix(k)-1);
if findstr(tok,'UTC')
end;
end;</lang>
Line 1,421:
echo preg_replace(
);
</lang>
Line 1,558:
=={{header|REBOL}}==
<lang REBOL>REBOL [
]
Line 1,618:
object WebTime extends Application {
}
</lang>
Line 1,847:
Debug.Print ReturnValue
MsgBox (ReturnValue)
End Sub</lang>
Line 1,856:
Mar. 05, 00:57:37 UTC Universal Time
</pre>
=={{header|VBScript}}==
<lang vb>Function GetUTC() As String
Url = "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
With CreateObject("MSXML2.XMLHTTP.6.0")
.Open "GET", Url, False
.send
arrt = Split(.responseText, vbLf)
End With
For Each t In arrt
If InStr(t, "UTC") Then
GetUTC = StripHttpTags(t)
Exit For
End If
Next
End Function
Function StripHttpTags(s)
With New RegExp
.Global = True
.Pattern = "\<.+?\>"
If .Test(s) Then
StripHttpTags = .Replace(s, "")
Else
StripHttpTags = s
End If
End With
End Function
WScript.StdOut.Write GetUTC
WScript.StdOut.WriteLine</lang>
{{Out}}
<pre>
Run getTime Subroutine
Apr. 21, 21:02:03 UTC Universal Time
</pre>
=={{header|Visual Basic .NET}}==
Line 1,894 ⟶ 1,935:
c:=data.seek(Void,0); // start of line
line:=data[c,data.seek(Void,1)-c].text;
line.print();
re:=RegExp(0'|.*(\d\d:\d\d:\d\d)|); // get time
Line 1,901 ⟶ 1,942:
{{out}}
<pre>
<BR>Mar. 18, 06:18:31 UTC
06:18:31
</pre>
|