다른 국가 세관 웹 사이트에서 가져온 세금을 긁는 웹 봇을 개발 중이며 다음 사이트에서 원하는 값을 검색하는 데 문제가 있습니다. http://www.aduanet.gob.pe/itarancel/arancelS01Alias CODIGO 옆의 테스트 값 3303000000. 검색하고자하는 값은 "Ad/Valorem"옆에있는 6 %이지만, ID 속성이나 클래스 또는 이와 직접적으로 관련이 있거나 적어도 그 근처에있는 테이블은 없습니다. 나는 .parent 및 .child 메서드를 사용하려고 시도했지만 성공하지는 못했습니다. 지금까지의 코드는 다음과 같습니다.VBA ID가없는 테이블에서 단일 값 가져 오기
Function Peru(partida As String) As String
'Open IE
Set objIE = New InternetExplorer
objIE.Visible = True
objIE.navigate "http://www.aduanet.gob.pe/itarancel/arancelS01Alias"
'Load sub
Cargar
'Navigate further into the website (Im using partida = 3303000000)
For Each box In objIE.document.getElementsByTagName("input")
If box.Name = "cod_partida" Then
box.Value = partida
Exit For
End If
Next
For Each boton In objIE.document.getElementsByTagName("input")
If boton.Value = "Consultar" Then
boton.Click
Exit For
End If
Next
'Get the 6% value (This part is the one I cant figure out)
End Function
당신이 후에있는 컨텐츠에 도달하려면, 당신은이'iframes'와 장애물에 있습니다. – SIM