문제

I'm trying to find a specific text value in my HTML page

I'm trying to use the GetElementsByName ( as it does not have any ID )

x = msgbox("Wait for page to load",64, "Job ID")
JobId = IE.Document.GetElementsByName("jobId")
x = msgbox((JobId.Value),64, "Job ID")

here is the HTML and the value that I want to extract Please help THANKS !

enter image description here

올바른 솔루션이 없습니다

다른 팁

Try x = msgbox((JobId(0).Value),64, "Job ID")

When you use the GetElementsByName tag, it will be returning back an array. If you only have one item with that name tag, you can always use JobID[0] to reference it.

How ever if you are going to have more than one item, you will have to do some sort of loop

For Each job in JobID
  msgbox((job.Value),64, "Job ID")
Next

You could also do something like this

inputs = IE.Document.getElementsByTagName("input")
For Each input in inputs
  If input.type = "hidden" && input.name = "JobId" Then
     msgbox((input.Value),64, "Job ID")
  End If
Next
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top