Find And Retrieve Web Data (1 Viewer)

Colorado Spring

Registered User.
Local time
Today, 10:46
Joined
Dec 10, 2005
Messages
36
Hey, All...

I've been tasked with development of a book library for my team. Several team members have requested that I include a function that would allow the user to go out to one of the book sites, i.e., Amazon.com, and pull the ISBN, author, etc. information from that site based on the book title entered into the db. We are using version 2007.

Is this possible?

Thanx :D
 

KeithG

AWF VIP
Local time
Today, 09:46
Joined
Mar 23, 2006
Messages
2,592
Yes it is possible. You have to create an instance of IE explore in your code and then use the document object to retrieve the data.
 

Colorado Spring

Registered User.
Local time
Today, 10:46
Joined
Dec 10, 2005
Messages
36
Thanx for the quick reply, Keith. Can you elaborate or perhaps give me an example of how the code might look?

Thanx again :)
 

KeithG

AWF VIP
Local time
Today, 09:46
Joined
Mar 23, 2006
Messages
2,592
First set a reference to the MIcrosoft Internet controls. Then past the below code into a module. The code will open up the barnes and nobles site and search for books named Access


Dim iExplorer As New InternetExplorer 'Internet Explorer Instance
Dim docHTML As Object 'HTML Document/Web Page
Dim sBaseURL As String


'Set iExplorer = CreateObject("IExplorer.Application")

sBaseURL = "http://www.bn.com"

iExplorer.Visible = True

iExplorer.Navigate2 sBaseURL

'Wait For Page to Load
Do While iExplorer.Busy
DoEvents
Loop

'Wait For Page to Load
Do While iExplorer.Busy
DoEvents
Loop

Set docHTML = iExplorer.Document

With docHTML
.All.Item("search-input").Value = "Access"
.All.Item("quick-search-button").Click

'Wait For Page to Load
Do While iExplorer.Busy
DoEvents
Loop


'Wait For Page to Load
Do While iExplorer.Busy
DoEvents
Loop
End With
 

Users who are viewing this thread

Top Bottom