Solved

URL address replace input form input for TAB key

Posted on 2011-02-26
8
271 Views
Last Modified: 2012-05-11
dear Experts,

I have one stock placement order input form from bank account provided. I would  like to do VBA code
to access the placement html page  after login in my bank account from VBA automation programming.
After login, I navigate https://online-banking.com./cgi-bin/ibnkprdhk/ist/order/orderPlacement.do?BV_UseBVCookie=Yes&sell=B%7C66921%7C1000%05123 in vba code
sell=B, where B means BUY or S mean SELL  for select radio button in the input form for stock order
66921 means for stock name number in the input form
1000 means for lot size for stock in the input form.

The edit of stock number of 66921 and lot size of 1000 is okay in URL bar  and no problem at all and it is shown in the
input form of placement order html page
But the question when I try to input stock price in URL address bar like 123 that is not shown in the form and
then I put %05 or %09 for simulating TAB key before stock price of 123 that is still not shown up too.
It is shown into lot size input box of the form  instead of price box like this as follows

OrderForm
========
Order TYPE :    o  BUY or  o SELL
Stock code: 66921
Stock Lots:   1000 123
Price:
Any suggestion for simulate TAB key code in URL bar ? And I am using IE7 in windows vista

Why, I'm NOT using DOM's  getelementbyName("price")=123 in vba because I could like to speed up
submit form speed instead of too much coding for  input each single input field in the input form like, ordertype,
stocknum, stocklotsize, stock prize.

Please advsie

Duncan
0
Comment
Question by:duncanb7
  • 5
  • 3
8 Comments
 
LVL 22

Accepted Solution

by:
rspahitz earned 500 total points
ID: 35020439
I don't think that's quite how it works.  The address link contains blocks of information that is arbitrarily interpreted by the code running behind the scenes.  In this case:

https://online-banking.com./cgi-bin/ibnkprdhk/ist/order/orderPlacement.do?BV_UseBVCookie=Yes&sell=B%7C66921%7C1000%05123

is split into parts:
* secure http
* online-banking.com domain
* cgi-bin/ibnkprdhk/ist/order/orderPlacement.do program
* BV_UseBVCookie=Yes&sell=B%7C66921%7C1000%05123 parameters supplied to the program

typically the program will split it based on the "&" and take all the text next to it and put it into the field
so you get:
BV_UseBVCookie=Yes
sell=B%7C66921%7C1000%05123

In this case, it seems to be further splitting it on code 7C to get: a list of values: B, 66921, 1000?123

Assuming that the program will interpret your value, it should probably be separated by another %7C:
sell=B%7C66921%7C1000%7C123

If that doesn't work, the only way to rea;lly do this is to write a program to intercept the browser and grab the data out of the address and parse through the page to find the right place to put the data, then insert it--no easy task (as you apparently know)
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35026530
Dear rspahitz,

I have tried sell=B%7C66921%7C1000%7C123 , it fail.
ANd I am interesting  the program to intercept the browers and grab the data out of the address, but how to detect the address when I sumbit the order form and I found the .LocationURL doesn't change at all once I click order submit button.

Please advise
Duncan
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35027143
Dear,

 I am found similar case when we download yahoo finance  history data like
http://finance.yahoo.com/q/hp?s=%5EDJI&a=09&b=1&c=1928&d=02&e=3&f=2011&g=d
we can progam the http path's a,b,c name variable in its html document  to locate what we want
the exact  data with program startdate and enddate without input the any variable in the form
shown in the website.

This should be doing the same for me to do program order at my
bank website from name variabel in its html
like
 <input type="radio" name="instructions" id="instructions" value="B"  />
<input type="text" id="symbol" name="symbol" maxlength="5"  value=""/>
<input class="inputMedium" type="text" id="quantity" maxlength="18" name="quantity"  value=""/>
<input class="inputMedium" type="text" id="price" name="price"  value=''/>

SoI try, I try this https://online-banking.com./cgi-bin/ibnkprdhk/ist/order/orderPlacement.do
BV_UseBVCookie=Yes&instruction=B&symbol=66921&quantity=1000&price=123, but it still fail, Any idea and Suggestion

Please advise
Duncan
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 35028051
duncan,

As I said, the program to capture the address and web page is not a trivial task.
I don't have time to write this but here is an option (to basically create a custom browser) :

Download VB.Net Express from microsoft.com
Create a new project.
Add a Web Browser control
Add a textbox for the address (if desired)
Set the Web Browser to Navigate to the desired location; if it changes, you can capture the address property.
when the DocumentLoaded even fires, you can dig into the document to locate the specific field that you want to put the data into
activate the web browser submit function if desired.

This can also be done with Excel VBA, but locating the field and pushing data into it is significantly harder.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 13

Author Comment

by:duncanb7
ID: 35031458
Dear rspahitz,


Act4ally I have already sent all input into order form with DOM 's method, but why I want to
program the order input at URL address because want to speed it up. From the  stocck data
vendor company, I have seen their software can beable to many transaction almost at the same
time within 1s for like 20 orders in the market. Do you think they are using C++ or Jave that is
much faster than VBA  ?

p=123
Do until price =130
.document.all("symbol").Value = 66921
.document.all("quantity").Value = 1000
.document.all("price").Value = 123
.document.all("submitbutton").Click
p=p+1
lopp
0
 
LVL 13

Author Comment

by:duncanb7
ID: 35031489
Dear rspahitz,


Act4ally I have already sent successfully  all input into order form with DOM 's method, but why I want to
program the order input at URL address because want to speed it up. From the  stocck data
vendor company, I have seen their software can be able to finsih  many transactions almost at the same
time within 1s for like 20 orders in the market. Do you think the faster speed they can make because
they are using C++ or Jave that isbmuch faster than VBA  ? Any more suggestion is welcome

p=123
Do until price =142
.document.all("symbol").Value = 66921
.document.all("quantity").Value = 1000
.document.all("price").Value = 123
.document.all("submitbutton").Click
p=p+1
lopp Accept and Award Points Accept as Solution
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 35031702
C++ is probably much faster than VBA; Java maybe/maybe not.
However, most of this will be controlled by the speed of your internet connection to the server, your ISP, and their server.  Using VBA to update the contents of a webpage will probably be quite fast unless it's a very complex page.

As for using the address to send the information, unless the hosting site supports it, it will never work.  If they simply don't accept the information you send, it will never get processed.

(I will be gone until Monday.  If you need additional help, you can try to add a low-point question and ask experts to look at this further.)
0
 
LVL 13

Author Closing Comment

by:duncanb7
ID: 35035016
Thanks for your reply
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now