Re: methods of object "Internet Explorer"
- From: JP <jp2112@xxxxxxxxxxxxx>
- Date: Sun, 3 Aug 2008 06:15:39 -0700 (PDT)
Joel,
Is this the whole code? I need to see how you are declaring the
objects you are using.
Thx,
JP
On Jul 28, 10:49 am, Joel <J...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
JP: I have a similar problem to an earlier posting. Can you help? thanks in.
advance. The code below is for excel. I klnow excel very well but not all
the web apllications.
I buying a new car and the lcoal dealer wants to charge me to shipped a car
from another dealer. I'm trying to find the dealer who has the car. So I
want to get a list of all the car dealers in my area and then search each
inventory on the web.
I simply go to the Nissan wepage setting the zipcode. The page only returns
4 results. I then change the distance box in code to 50 miles and press the
Search button in code which returns 55 results. I'm have to manually break
the code because I can't get the code to wait for the Search to complete. I
also can get the 1st 10 reults, but the other results are on other pages and
can't find the data. Right now I'm trying to change the *** box from ***
1 to *** 2.
The webpage is writen in Java and I don't know Java, but do know Excel Macro
very well. Not sure if this is best way of getting data but have some code
that works. Having two problems as documented in the code
1) I can't get the code to wait for a Java script to complete. The code
does work when a webpage is loading.
2) I can only get the 1st 10 returned item out of 55 items. The rest of the
items are on additional pages and can't change sheets.
Sub GetDealers()
URL = "http://www.nissanusa.com/apps/dealerlocator"
Request = "?zipCode=07508&tool=Home.Locator"
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
'get web page
IE.Navigate2 URL & Request
Do While IE.readystate <> 4
DoEvents
Loop
'get search button
Set but = IE.document.getElementById("mainSearchButton")
'put distance in listbox on webpage
Set radius = IE.document.getElementById("radius")
radius.Value = "50"
'search again a larger distance
'Select Search button and activate
but.Select
but.Click
Set SearchResults = IE.document.getElementById("searchResults")
Do While IE.busy = True
DoEvents
Loop
- Follow-Ups:
- Re: methods of object "Internet Explorer"
- From: Joel
- Re: methods of object "Internet Explorer"
- Prev by Date: Re: forward and backward slide transitions .. programming differen
- Next by Date: Re: forward and backward slide transitions .. programming differen
- Previous by thread: Re: methods of object "Internet Explorer"
- Next by thread: Re: methods of object "Internet Explorer"
- Index(es):