View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Pick data from web page (no query)

there are two possible reasons that I can immediately think of that may be
causing the problem.

1) That the items are not in the IE.Document. It is something else beside a
document.
2) The code isn't waiting for the webpage to get the data before it reads
the data.

I usually set break points a first get the code working by stepping through
the instructions. I can wait until the webpage is updated before continue to
step through the code. Then I go back and try to get it to work
automatically. Here is a sample of code where I couldn't get the IE READY to
wrok. I had to use a return value from the page to force the code to wait.


'get search button
Set but = IE.document.getElementById("mainSearchButton")
'put distance in listbox on webpage
Set radius = IE.document.getElementById("radius")
radius.Value = "100"


'search again a larger distance
'Select Search button and activate
but.Select
but.Click

On Error Resume Next ' Defer error handling.
Do
Err.Clear
Set PageNumber = IE.document.getElementById("pageNumber")
Pages = PageNumber.Value
DoEvents
Loop While Err.Number < 0
On Error GoTo 0


"rik" wrote:

I'm sorry to say but i tried "dumpdata" with 3 web pages :

1. the page to log in (which you can see as well) : it works perfectly well
2. the home page you get on once you're logged in : it runs without failure
but nothing is dumped into the excel sheet : he finds 9 empty items
3. the page i wanted to work with : same as 2 : also 9 empty items, so it
seems to be the same page, although a different page is seen on the screen

There must be something tricky that i don't understand ???
Does it make sense to try to go to the wanted page by filling in name and
password, and then click 2 buttons automatically ?