Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
| Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 16th, 2003, 03:20 AM
Authorized User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Capturing Javascript form via Excel web query

I'm trying to capture data from a web site via an Excel web query, and everything seems to work, except for the very last step. I am not a javascript expert at all (Excel is more my field) so apologies if my description is inaccurate.

In the Excel web query, I specify the address of the web page, as well as the parameters for the javascript form. That all seems to work fine. However I cannot get the form "submit" itself and actually load the data I want to capture. Is there a way to get that to happen by adding something to the url?

This is the url to the form itself: http://www.bmreports.com/servlet/com....bwp_PanBmData

This is an example url I use to enter the parameters: http://www.bmreports.com/servlet/com...06-14&param6=*
(Sorry, long url - you might have to copy-paste)

Would be very grateful for any help!
 
Old July 16th, 2003, 04:06 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

The trouble is the page uses the post method. There are two ways round this that I can see, either make sure there is some data in each query box, if there is the form should submit automatically. The second option is to do your own web query, i.e. don't use the built in functionality to get more control of what is going on. You would need to use the IXmlHttpRequest interface.

--

Joe
 
Old July 16th, 2003, 08:57 AM
Authorized User
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!
However I have never used xmlhttp before. Here's what I have achieved this far (and it doesn't work):

Sub XMLTest()
    Dim XMLhttp: Set XMLhttp = CreateObject("msxml.xmlhttp")
    Dim Result
    Dim ReqString: ReqString = "?param1=i_isg-spow1&param5=2003-06-14&param6=*"
    XMLhttp.Open "POST", "http://www.bmreports.com/servlet/com.logica.neta.bwp_PanBmData", False
    XMLhttp.setrequestheader "Content-Type", "application/x-www-form-urlencoded"
    XMLhttp.send ReqString
    Result = XMLhttp.responsetext
    MsgBox Result
End Sub

I get a "Bad Request" error message - what am I missing?
 
Old November 25th, 2004, 12:19 PM
Registered User
 
Join Date: Nov 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you can also try this excel web sharing tool here: http://badblue.com/badblue-excel-web....htm?from=disc, which is freely downloadable.








Similar Threads
Thread Thread Starter Forum Replies Last Post
excel write to web java applet form mlov83 Excel VBA 0 April 30th, 2008 12:26 PM
capturing asp data in clientside javascript Terry Joseph Migliorino Javascript How-To 9 November 2nd, 2005 09:10 AM
capturing asp data in clientside javascript Terry Joseph Migliorino Javascript 1 October 31st, 2005 01:42 PM
Excel to Web Form Merge!!! j3lunt HTML Code Clinic 2 January 8th, 2005 02:53 PM
merging data from web form to excel spreadsheet fmh002 Classic ASP Basics 1 June 30th, 2003 04:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.