我想一个vba代码去这个网址"http://www.anbima.com.br/ima/ima.asp",然后点击"IRF-M“按钮,然后点击”咨询“按钮。
我试过了,但失败得很惨烈:
'inserir website com os valores a serem buscados
sitedv01 = "http://www.anbima.com.br/ima/ima.asp"
'busca no site
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.navigate sitedv01
'espera o carregamento
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
Set tags = IE.document.getElementsByValue("irf-m")
For Each tagx In tags
If tagx.src = "http://www.bmf.com.br/bmfbovespa/images/comum/mais.gif" Then
tagx.Click
End If
Next发布于 2018-02-21 18:17:02
尝试下面的方法。该脚本将首先单击IRF-M,然后单击Consultar。但是,当两次单击都成功启动时,您将看到一个包含所需数据的新窗口。
Sub Get_Data()
With CreateObject("InternetExplorer.Application")
.Visible = True
.navigate "http://www.anbima.com.br/ima/ima.asp"
While .Busy = True Or .readyState < 4: DoEvents: Wend
.document.querySelector("input[value='irf-m']").Click
.document.querySelector("img[name='Consultar']").Click
End With
End Subhttps://stackoverflow.com/questions/48892307
复制相似问题