Moderatori: Anthony47, Flash30005
<article class="l-grid__cell">
<div class="w-999 | l-box">
<div class="l-box">
<div class="l-box">
<h1 class="t-text -flola-bold -size-xlg -inherit"> Carmignac Patrimoine E Eur Acc
</h1>
</div>
<div class="l-box">
<span class="t-text -size-lg -black-warm-60"><strong>176,06</strong></span>
<span class="t-text -size-lg -cbalanced"><strong>+0,16%</strong></span>
</div>
<div class="w-999__bcol | l-box | l-screen -sm-9 -md-9">
<span class="t-text -block -size-xs">Valuta: <strong>EUR</strong></span>
<span class="t-text -block -size-xs | -xs">Data: <strong>25/03/21</strong></span>
</div>
<div class="w-999__bcol -last | l-box | l-screen -sm-6 -md-6">
<!-- PORTFOLIO -->
<span class="t-text -flola-bold -uppercase -inherit"><a title="Portafoglio" href="/borsa/user/borsa-virtuale/portafoglio-aggiungi-strumento.html?code=2CARPATE"><span class="m-icon -portfolio-xs"></span> Portafoglio</a></span>
<!-- ALERT -->
<span class="t-text -flola-bold -uppercase -inherit"><a title="Email Alert" href="/borsa/pagina-personale/alerts/imposta-alert.html?id=2CARPATE&lang=it"><span class="m-icon -alert-xs"></span> Email Alert</a></span>
</div>
</div>
</div>
</article>
#If VBA7 Then '!!! ON TOP OF THE VBA MODULE !!!!
Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr)
#Else
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
#End If
Sub ScanTitoli()
Dim IE As Object, myF As Object, I As Long
'
For I = 2 To Cells(Rows.Count, 2).End(xlUp).Row
myUrl = Cells(I, 2) 'L'url della pagina da accedere
If InStr(1, myUrl, "http", vbTextCompare) = 1 Then
'Se url valido, apre tramite InternetExplorer...
If IE Is Nothing Then Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True '... rendi visibile IE
.navigate myUrl '....vai all'url
Sleep 100 '
Do While .Busy: DoEvents: Sleep (20): Loop 'Attesa not busy
Do While .readyState <> 4: DoEvents: Sleep (20): Loop 'Attesa document
End With
Sleep (100) 'Stabilizza
'Cerca le voci di interesse
On Error Resume Next
Set myF = IE.document.getElementsByClassName("w-999")
Cells(I, "C").Value = myF(0).getElementsByTagName("h1")(0).innerText 'Descrizione
Cells(I, "E").Value = (myF(0).getElementsByTagName("strong")(0).innerText) 'quotazione
Cells(I, "G").Value = (myF(0).getElementsByTagName("strong")(1).innerText) 'variazione
Set myF = IE.document.getElementsByClassName("w-999__bcol")
Cells(I, "F").Value = myF(0).getElementsByTagName("strong")(1).innerText 'data
Set myF = IE.document.getElementsByTagName("table")
Cells(I, "H").Value = (myF(2).getElementsByTagName("td")(1).innerText) 'Rendimenti
Cells(I, "I").Value = (myF(2).getElementsByTagName("td")(5).innerText) 'Rendimenti
Cells(I, "J").Value = (myF(2).getElementsByTagName("td")(7).innerText) 'Rendimenti
Cells(I, "K").Value = (myF(2).getElementsByTagName("td")(9).innerText) 'Rendimenti
Set myF = IE.document.getElementsByClassName("l-grid__row")
gest = myF(6).innerText
Cells(I, "L") = Application.WorksheetFunction.Clean(Split(gest, Chr(10), , vbTextCompare)(5))
On Error GoTo 0
End If
Next I
'Chiusura
On Error Resume Next
IE.Quit
Set IE = Nothing
End Sub
<!-- CARATTERISTICHE-BANNER:begin -->
<article class="l-grid__cell | l-screen -md-8">
<div class="l-box | l-screen -sm-15 -md-15">
<h3 class="t-text -flola-bold -size-lg -uppercase | l-box -pb">Caratteristiche</h3>
<div class="l-box -prl | h-bg--gray | l-screen"><br>
<table class="m-table -clear-mtop">
<tr>
<td class="l-screen -xs-half">
<span class="t-text"><strong>Isin</strong></span>
</td>
<td>
<span class="t-text -right">FR0010306142</span>
</td>
</tr>
<tr>
<td>
Set myF = IE.document.getElementsByClassName("w-999__bcol")
Cells(I, "A").Value = myF(0).getElementsByTagName("strong")(2).innerText 'IO ISIN
Cells(I, "F").Value = myF(0).getElementsByTagName("strong")(1).innerText 'data
Set myF = IE.document.getElementsByTagName("table")
Cells(I, "H").Value = (myF(2).getElementsByTagName("td")(1).innerText) 'Rendimenti
Cells(I, "I").Value = (myF(2).getElementsByTagName("td")(5).innerText) 'Rendimenti
Cells(I, "J").Value = (myF(2).getElementsByTagName("td")(7).innerText) 'Rendimenti
Cells(I, "K").Value = (myF(2).getElementsByTagName("td")(9).innerText) 'Rendimenti
Cells(I, "A").Value = myF(1).getElementsByTagName("td")(1).innerText 'ISIN +++++++
Set myF = IE.document.getElementsByClassName("l-grid__row")
Torna a Applicazioni Office Windows
Inserire dati filtrati da 2 file ad un terzo file Autore: Ricky0185 |
Forum: Applicazioni Office Windows Risposte: 14 |
Perchè l'importazione dati con Selenium non fuziona? Autore: aggittoriu |
Forum: Applicazioni Office Windows Risposte: 7 |
copia di dati da un file chiuso e elaborazione Autore: luca62 |
Forum: Applicazioni Office Windows Risposte: 2 |
Visitano il forum: Nessuno e 12 ospiti