views:

166

answers:

1

I am trying to use WebBrowser control to click a button that doesn't have any anchor text or anything

I looked at the source and saw this.

var _tm7 = new TabMenu( 'TempoTabMenuControl', 'TempoTabMenuControlRow', ['Add Edit'], 0); _tm7.Add(new TabMenuItem('View Menu', '/Edit/NewUI.html?tstudio=45', 'main'), true); _tm7.Add(new TabMenuItem('Property List', '/Edit/Scripts/PrpList.asp', 'display'), false); _tm7.Add(new TabMenuItem('New Listing', '/Edit/Scripts/NewList.asp', 'display'), false);

I guess its script to populate the fields of the dropdown menu. I want to get to "/Edit/Scripts/NewList.asp" but I have to do it with the javascript because the NewList.asp is only configured to work from within a frame with the main page as the parent.

The Javascript file they use is here:

http://www.dailynewstube.com/Tabs.js

Is there some way to activate some kind of evil javascript method or something from the WebBrowser control?

Javascript Gurus Please HelP!!

+1  A: 

Most Web browsers have some sort of console that can be used to execute arbitrary JavaScript. Most also support an arguably faster method of executing JavaScript: placing javascript:[insert code here];void(0); in the URL bar.

I'm guessing by "WebBrowser control", you mean a program with an embedded web browser, as opposed to a real web browser. The "javascript: in URL bar" method may still work, or if not, you could try browsing to the website in a real web browser and using its JavaScript console. Otherwise, you're pretty much out of luck unless you do something fancy involving a proxy.

Zarel
Thanks for the idea. The problem is a suck at Javascript and wouldn't even know what command to execute. I've been working on this for 20 hours straight and I am screwed if this isn't working in 5 hours :(
Proximo
Um, do you have some sort of link? Without knowing what page it is, and which anchor it is, I won't know which command to execute, either.
Zarel
Zarel, definetely. The only problem is its a password protected website and I just don't want to put the login and password on the net. Got an email I can send you the information to?
Proximo
Zarel, thanks you really understood the situation and helped with your original answer. The funny thing is.. looking back at this question the title really didn't make sense at all huh? Any way I really owe you, I'm doing things that I thought were impossible before now!
Proximo
I'm glad I could be of help. Do you still need help with which command to execute? If so, my e-mail address is [email protected]
Zarel