views:

325

answers:

2

I have been scraping the Internet for some solution to this problem with no success. I need to use vbscript to launch a URL within Internet Explorer and click a button. The challenge that I am having is that the button has no id or name. It only has a specified type and value. I have tried different methods with no success. I would love some help if you can.

Thank you.

+1  A: 

Use getElementsByTagName to find all of the button elements (or input elements) in the page and then look at the name property to see if it is the one you want.

Dominic Cooney
Ah. Should have thought of that. I will give that a shot. Thanks.
jmcdev
sorry. Having trouble using this. Can you provide an example? Keep getting object required no matter how I slice it.
jmcdev
Can you post a reduced example with HTML and VBscript?
Dominic Cooney
A: 

Try this with groovy:

import org.codehaus.groovy.scriptom.*;

Scriptom.inApartment
{
  def ie = new ActiveXObject('InternetExplorer.Application')

  ie.Visible = true
  ie.AddressBar = true

  ie.Navigate("http://glaforge.free.fr/weblog")
}

This code is from http://repository.codehaus.org/org/codehaus/groovy/modules/scriptom/scriptom-all-assembly/1.6.0/scriptom-all-assembly-1.6.0.zip

David