Moderatori: Anthony47, Flash30005
Sub Rettangolo1_Click()
Dim Y As String, X As String
'
X = Foglio1.Range("K1").Value & ""
Y = Foglio1.Range("K2").Value & ""
myURL = "https://www.worldweatheronline.com/" & X & "/" & Y & "/it.aspx"
Foglio1.Range("A5:G100").ClearContents 'AZZERA l'area dei risultati
Call GetWheatherSub(myURL)
MsgBox ("Fatto...")
End Sub
Sub GetWheatherSub(ByVal myURL As String)
Dim Y As String, X As String
Dim Getimgurl As HeaderFooter, OggCol As Object, OggCol2 As Object, OggCol3 As Object
'Va Chiamata passandogli l'URL da leggere
'myURL = "https://www.worldweatheronline.com/" & X & "/" & Y & "/it.aspx"
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate myURL
.Visible = True
Do While .Busy: DoEvents: Loop 'Attesa not busy
Do While .readyState <> 4: DoEvents: Loop 'Attesa documento
End With
'Stop '*** VEDI Testo
'myStart = Timer 'attesa addizionale
Do
DoEvents
If Timer > myStart + 2 Or Timer < myStart Then Exit Do
Loop
'Scrive sul Foglio Attivo
On Error Resume Next
Set OggCol = ie.document.getElementsByClassName("flickity-slider")
Set OggCol2 = OggCol(0).getElementsByTagName("div")
Set OggCol3 = OggCol(0).getElementsByTagName("img")
For i = 0 To OggCol2.Length
Range("A5").Offset(i, 0) = OggCol2(i).innerText
Range("A5").Offset(i, 1) = Replace(OggCol3(i).getAttribute("src"), "//", "", , , vbTextCompare)
Next i
On Error GoTo 0
Foglio1.Range("A:A").WrapText = False
'Chiusura IE
ie.Quit
Set ie = Nothing
End Sub
myURL =
Dim Getimgurl As HeaderFooter, OggCol As Object, OggCol2 As Object, OggCol3 As Object
Set OggCol2 = OggCol(0).getElementsByTagName("div") ' Qui posso dedurre che sia una parte della Pagina Html
Set OggCol3 = OggCol(0).getElementsByTagName("img") ' Questa ricade solo sull'immagine desiderata
For i = 0 To OggCol2.Length
Range("A5").Offset(i, 0) = OggCol2(i).innerText ' Qui si desidera solo estrapolare il solo testo che in questo caso e il link per ogni immagine
Range("A5").Offset(i, 1) = Replace(OggCol3(i).getAttribute("src"), "//", "", , , vbTextCompare) ' E questa porzione di codice non la conosco proprio
Next i
Foglio1.Range("A:A").WrapText = False ' E per finire a che cosa serve il codice ( WrapText ) Quale è il suo scopo?
Mi risulta che non sei romano, e si vedeE come dicono a Roma ( Sei er meio der meio )
Range("A5").Offset(i, 1) = Replace(OggCol3(i).getAttribute("src"), "//", "", , , vbTextCompare) ' E questa porzione di codice non la conosco proprio
https:
Range("A5").Offset(i, 1) = Replace(OggCol3(i).getAttribute("src"), "//", "https://", , , vbTextCompare)
For Each Pict In ActiveSheet.Shapes
' Selection.ShapeRange.LockAspectRatio = msoFalse '<<Vedi Nota **
Pict.Height = 50
Pict.Width = 50
Next Pict
Torna a Applicazioni Office Windows
Powerline TP-LInk: come connetterli tra loro Autore: giovannib87 |
Forum: Reti, ADSL e wireless Risposte: 4 |
Immagine visibile e in posizione definita Autore: BG66 |
Forum: Applicazioni Office Windows Risposte: 21 |
adattare il contenuto alla pagina Autore: trittico69 |
Forum: Applicazioni Office Windows Risposte: 12 |
Visitano il forum: Nessuno e 13 ospiti