[ETL] Comandi di base
Posted by Armen on 11-05-2005 09:02
Spero che a qualcuno possa essere utile ;)

code:
//Apertura di una pagina in IE e dichiarazione della variabile doc //(document rappresenta la struttura principe di una pagina html) var http; var oIE = new ActiveXObject("InternetExplorer.Application"); oIE.Navigate(""); var doc = oIE.Document; //Richiesta di info su una determinata pagina html ("http://www.dsi.unimi.it"). //La risposta รจ inserita in doc. try { http = new ActiveXObject("Microsoft.XMLHTTP"); http.open("GET", "http://www.dsi.unimi.it", false); http.send(); doc.write(http.responseText); } catch (e) { WScript.echo("Errore: "+e.description); } //Dichiarazione oggetti xml var xmldoc = new ActiveXObject("Msxml2.DOMDocument"); xmldoc.async = false; xmldoc.validateOnParse = true; //Creazione e inserimento nel documento xml della Processing Instruction var objPI = xmldoc.createProcessingInstruction('xml','version="1.0"'); xmldoc.appendChild(objPI); //Creazione e inserimento nel documento xml della radice file xml var rootElement = xmldoc.createElement("Sito"); xmldoc.documentElement = rootElement; //Salvataggio del documento xml xmldoc.save("E_XercizioArmen.xml"); WScript.echo("Documento XML creato e salvato!");

Powered by: vbHome (lite) v3.8 and vBulletin v2.3.1
Copyright © 2000 - 2002 Jelsoft Enterprises Limited