Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
29
Task/Web-scraping/M2000-Interpreter/web-scraping.m2000
Normal file
29
Task/Web-scraping/M2000-Interpreter/web-scraping.m2000
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
Module Web_scraping {
|
||||
Print "Web scraping"
|
||||
function GetTime$(a$, what$="UTC") {
|
||||
document a$ ' change string to document
|
||||
find a$, what$ ' place data to stack
|
||||
Read find_pos
|
||||
if find_pos>0 then
|
||||
read par_order, par_pos
|
||||
b$=paragraph$(a$, par_order)
|
||||
k=instr(b$,">")
|
||||
if k>0 then if k<par_pos then b$=mid$(b$,k+1) :par_pos-=k
|
||||
k=rinstr(b$,"<")
|
||||
if k>0 then if k>par_pos then b$=Left(b$,k-1)
|
||||
=b$
|
||||
end if
|
||||
}
|
||||
declare msxml2 "MSXML2.XMLHTTP.6.0"
|
||||
rem print type$(msxml2)="IXMLHTTPRequest"
|
||||
Url$ = "http://tycho.usno.navy.mil/cgi-bin/timer.pl"
|
||||
try ok {
|
||||
method msxml2, "Open", "GET", url$, false
|
||||
method msxml2,"Send"
|
||||
with msxml2,"responseText" as txt$
|
||||
Print GetTime$(txt$)
|
||||
}
|
||||
If error or not ok then Print Error$
|
||||
declare msxml2 nothing
|
||||
}
|
||||
Web_scraping
|
||||
Loading…
Add table
Add a link
Reference in a new issue