1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| Sub AMS_Prices_Load_Forum()
Dim IE As New InternetExplorer
Dim IEDoc As HTMLDocument
Dim IEDocInt As HTMLDocument
Dim ws As Worksheet
Set ws = ActiveSheet
'Chargement d'une page Web Google
IE.Navigate "http://marketnews.usda.gov/portal/lg?paf_dm=full&reportConfig=true&paf_gear_id=4300017&category=Grain+Basis"
'Affichage de la fenêtre IE
IE.Visible = True
'On attend le chargement complet de la page
WaitIE IE
'On pointe le membre Document
Set IEDoc = IE.document
' Recupere les différentes listes de la page sur lesquelles on veut faire des choix
Set categoryList = IEDoc.all("category")
Set commodityList = IEDoc.all("commodity")
Set subCommList = IEDoc.all("subComm")
Set repTypeList = IEDoc.all("repType")
Set locList = IEDoc.all("loc")
Set commDetailList = IEDoc.all("commDetail")
Set dateDeb = IEDoc.all("repDate")
Set dateFin = IEDoc.all("endDate")
' On rentre des valeurs dans chaque liste
dateDeb.Value = "01/01/2009"
dateFin.Value = "01/02/2009"
categoryList.Value = "Grain Basis"
IEDoc.parentWindow.execScript "processOrganic()"
commodityList.Value = "Coarse"
IEDoc.parentWindow.execScript "processReportType()"
subCommList.Value = "Corn"
IEDoc.parentWindow.execScript "processFrequencies()"
repTypeList.Value = "Daily"
IEDoc.parentWindow.execScript "processFrequencyChange()"
locList.Value = "All"
IEDoc.parentWindow.execScript "processPriCutValue()"
commDetailList.Value = "All"
IEDoc.parentWindow.execScript "processTypeChange()"
' Go
Set go = IEDoc.all("run")
go.Click
WaitIE IE
' ==> PROBLEME
' Ici j'aimerais récupérer les propriétées de la page, mais ca ne correspond pas
' J'utilise le meme wording que précédement
Set IEDocInt = IE.document
zz = IEDocInt.getElementsByClassName("ReportsTableHeader").Length
End Sub |
Partager