Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drive a webpage?

Status
Not open for further replies.

waynebrady

Programmer
Feb 20, 2003
24
US
Is there a way, using the ActiveX Browser in VFP7, to "drive" a webpage that I have no authority over? If I know the the field name or button name on a web page, is it possible to populate a webpage field and click a webpage's button? I'm trying to automate a repetative process of looking up an order status screen for many "order numbers" in my local VFP table at my vendors site.
In looking at the PEMs, I don't have any good documentation on the PEMs for the ActiveX browser object. If anyone knows where to get more detail, that would be helpful.

Thanks,


Wayne Brady
 
Yup, it's possible.

I'm not sure how much you know about HTML/HTTP,etc, but what you're talking about has been described as "Screen scraped web services"... essentially making VFP emulate a browser and access the web pages "scraping" the data off of them.

There are two different ways of getting a web page: GET and POST. GET is simpler to "drive", since all form info is stored in the URL. POST is a little harder, but not impossible.

See faq184-4359 for how to GET or POST form data.
See faq184-3019 for how to GET a web page.
See forum184 faqs, section "internet" for other internet tricks in vfp.
 
West Wind has there wwip class that
give a frame work for this.
A little lot eaiser

DO wwhttp
oHTTP = CREATEOBJECT("wwHTTP")
oHTTP.HTTPConnect("zip4.usps.com/zip4")
*** Connect to the server
*oHTTP.HTTPConnect("*oHTTP.HTTPConnect("*oHTTP.HTTPConnect("*** Let's post some data TO the server

oHTTP.AddPostKey("Selection","1")
oHTTP.AddPostKey("urbanization","")
oHTTP.AddPostKey("firm","")
oHTTP.AddPostKey("address1",addr12)
oHTTP.AddPostKey("address2","")
oHTTP.AddPostKey("city",city1)
oHTTP.AddPostKey("state",state1)
oHTTP.AddPostKey("zipcode",zipcode1)
oHTTP.AddPostKey("submit","")

*** Initialize the variables that will be filled by HTTPGetEx
lcHTML="" && Data buffer
lnText=0 && Size of the output to return - 0 means autosize
*** Send the POST data and retrieve HTTP result
lnResult =oHTTP.HTTPGetEx("/zip4_responseA.jsp",@lcHTML,@lnText)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top