Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [DOM] xml, html &co
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
francyghisla
.non è possibile.

User info:
Registered: Nov 2003
Posts: 632 (0.08 al dì)
Location:
Corso: TICOM
Anno: Primo
Time Online: 13 Days, 10:16:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Question [DOM] xml, html &co

MISTERO 1:
Ho un problema con DOM, o meglio non riesco a capire perchè dal nodo body mi trovi un solo figlio div, quando in realtà ce ne sono molti di più.... :?

perchè lo fa solo con il body e ad esempio non lo fa con l'head? li mi riconosce che ha 9 figli, e il codice è lo stesso che passa a tappeto tutti i nodi :shock:

-> magari vi può essere utile sapere che mi sto riferendo all'ultimo compitino di sadegh, per etl turno unico del secondo anno e la pagina da analizzare è la lettera A del dizionario deMauro-Paravia

grazie a chiunque mi illumini su questo mistero... :-D

22-06-2005 12:57
Click Here to See the Profile for francyghisla Click Here to See the Blog of francyghisla Click here to Send francyghisla a Private Message Find more posts by francyghisla Add francyghisla to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.20 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged


magari vi può essere utile sapere che mi sto riferendo all'ultimo compitino di sadegh

L'impressione non mi aveva sfiorato neanche lontantamente :D

Posteresti i relativi pezzi di codice (se non ti costringono a rivelare parti importanti del progetto :))?

__________________
?

22-06-2005 21:23
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
francyghisla
.non è possibile.

User info:
Registered: Nov 2003
Posts: 632 (0.08 al dì)
Location:
Corso: TICOM
Anno: Primo
Time Online: 13 Days, 10:16:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

code:
function testoNodo(e) { var testo = ""; // se il nodo contiene figli rilancio la funzione var i=0; WScript.echo("il tag: "+e.tagName+" ha figli numero "+e.children.length); if (e.children.length>0) { WScript.echo("Sono tra l'if e il while e il tag ha figli numero"+e.children.length); while (i<e.children.length) { testo = testo + " " + testoNodo(e.children(i)); WScript.echo("SONO NEL WHILE il nodo su cui sono è "+e.children(i).tagName+" e i = "+i); i++; } testo = testo + " " + e.innerText ; WScript.echo("FINITO IL WHILE e ho trovato il seguente testo tra tag che aveva figli: " +e.innerText); } //se non contiene più figli prendo il testo che contiene il nodo else { if (e.innerText != "") { testo = testo + " " + e.innerText ; WScript.echo("NON SONO NEL WHILE e ho trovato il seguente testo tra tag: " +e.innerText); } else WScript.echo("NON SONO NEL WHILE il testo trovato è ancora quello di prima: "+testo); // var par = e.parentNode; // par.removeChild(e); } //se il testo estrapolato è diverso da "" lo salvo nel file xml if (testo != "") { return testo; } }


figurati, nessuna rivendicazione sui copyright ;)

è la funzione ricorsiva che uso per leggere tutti i nodi, lascia perdere le mille echo che mi servivano per sapere se avevo fatto giusto.... mah, è un bel mistero!

-> MISTERO 2: perchè se in un ciclo for in cui faccio passare tutti i verbi del sito logos, trova tutte le pagine, ma legge il nodo solo della prima?!!?! uffa!

23-06-2005 07:58
Click Here to See the Profile for francyghisla Click Here to See the Blog of francyghisla Click here to Send francyghisla a Private Message Find more posts by francyghisla Add francyghisla to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.20 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Mah guarda... così a occhio non saprei da dove cominciare a leggere il codice :D

Tra l'altro ho visto (nel forum di etl) che ci sono problemi con <div> & friends...

Io dopo 2 o tre tentativi non sono riuscito a tirare fuori tutto l'XML dalla pagina (più o meno indirettamente sia passando da XMLHTTP che dall'ActiveX InternetExplorer).

Può darsi che stia procedento nel modo sbagliato (non sto controllando le specifiche, quindi in tal caso se qualcuno me lo segnalasse gliene sarei grato :D) ma ho deciso di prendere quello che mi interessa direttamente dall'HTML, in fondo le cose interessanti (parola, analisi e link) sono tra i link il cui href è un numero.

Che dici?

__________________
?

24-06-2005 13:09
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
francyghisla
.non è possibile.

User info:
Registered: Nov 2003
Posts: 632 (0.08 al dì)
Location:
Corso: TICOM
Anno: Primo
Time Online: 13 Days, 10:16:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

allora dopo lungo meditare, grazie a kjir, abbiamo scoperto che è un problema di caratteri nascosti... prova a vedere sul forum di etl, l'ha spiegato bene li

però se ti salvi le pagine in locale e le leggi dalla cartella virtuale funziona... i misteri...

24-06-2005 14:10
Click Here to See the Profile for francyghisla Click Here to See the Blog of francyghisla Click here to Send francyghisla a Private Message Find more posts by francyghisla Add francyghisla to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.20 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Sì, ho visto i messaggi anche di là, ma ho postato qui perchè era meno incasinato :)

Alla fine l'importante è ottenere lo stesso risultato e non violare le specifiche ;) (anche se non mi sembra abbia dato vincoli particolari).

Una curiosità: tu hai usato XMLHTTP per ricevere la pagina? E poi ne hai ricavato l'xml? Perchè io non ci sono riuscito (ho provato un paio di metodi e proprietà ma nulla)

__________________
?

24-06-2005 20:22
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
francyghisla
.non è possibile.

User info:
Registered: Nov 2003
Posts: 632 (0.08 al dì)
Location:
Corso: TICOM
Anno: Primo
Time Online: 13 Days, 10:16:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

abbiamo usato XMLHTTP, però abbiamo portato le pagine del demauro in locale e salvate nella wwwroot, di modo che le prendevamo con http://localhost/sitoletteraAinlocale.html

così funziona... se il prof a qualcosa da ridire chiedamo a lui come si fa a saltare i caratteri "trappola"

più di così non sappiamo che inventarci!

24-06-2005 21:06
Click Here to See the Profile for francyghisla Click Here to See the Blog of francyghisla Click here to Send francyghisla a Private Message Find more posts by francyghisla Add francyghisla to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.20 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Un'altra curiosità, allora :D Come avete fatto a salvare le pagine da XMLHTTP?

Grazie :)

__________________
?

24-06-2005 21:42
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
francyghisla
.non è possibile.

User info:
Registered: Nov 2003
Posts: 632 (0.08 al dì)
Location:
Corso: TICOM
Anno: Primo
Time Online: 13 Days, 10:16:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

proprio alla brutta maniera? :D

aperte da browser, le abbiamo recuperate prendendo il sorgente e salvandolo nella wwwrooot...

25-06-2005 07:18
Click Here to See the Profile for francyghisla Click Here to See the Blog of francyghisla Click here to Send francyghisla a Private Message Find more posts by francyghisla Add francyghisla to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.20 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ah quindi con responseHTML?

No, aspetta... ma con l'ActiveX di IE? ... Sto cercando di capire che metodi e oggetti avete usato (anche non il codice dello script, proprio solo il nome dei metodi)

(Ti sto facendo il terzo grado :asd: )

__________________
?

Last edited by yeah on 25-06-2005 at 20:20

25-06-2005 20:15
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
francyghisla
.non è possibile.

User info:
Registered: Nov 2003
Posts: 632 (0.08 al dì)
Location:
Corso: TICOM
Anno: Primo
Time Online: 13 Days, 10:16:55 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ti scrivo operazione per operazione :D

1- apri il sito da browser
2- tasto destro mostre HTML
3- salva con nome -> C:\inetpub\wwwroot\nomecheuvoidarealsito.html
4- leggi con

code:
try { http = new ActiveXObject("Microsoft.XMLHTTP"); http.open("GET", nomeSito, false); http.send(); doc.write(http.responseText); } catch (e) { WScript.echo("Errore: "+e.description); }

dove nome sito è htttp://localhost/nomechehaidatoalsitosalvato.html


-> in questo modo legge correttamente le pagine ;) a prenderle da locale e non direttamente dalla rete salta quei caratteri strani che davano problemi...

26-06-2005 08:00
Click Here to See the Profile for francyghisla Click Here to See the Blog of francyghisla Click here to Send francyghisla a Private Message Find more posts by francyghisla Add francyghisla to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
yeah
.grande:maestro.

User info:
Registered: Nov 2003
Posts: 1644 (0.20 al dì)
Location: Cologno Monzese
Corso: Informatica Magistrale
Anno: II
Time Online: 12 Days, 21:36:41 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ah... ora è tutto chiaro :) Infatti stavo spulciando il manuale di xmlhttp o dell'activex ie per capire come si salva una pagina :D

Ok grazie

__________________
?

26-06-2005 14:06
Click Here to See the Profile for yeah Click here to Send yeah a Private Message Find more posts by yeah Add yeah to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 21:30.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.103 seconds (68.59% PHP - 31.41% MySQL) con 22 query.