Click Web Page Image

R

ron

I'm trying to access a web page so that I can collect and process the
data back in Excel. Unfortunately the page preceding it is password
protected, so you won't be able to view the page first-hand. In any
case, the page I'm stuck on contains a gif image that needs to be
clicked in order to proceed to the desired page with the data. I
can't figure out how to get beyond this page with the gif image. Here
is some information.

When the cursor moves over the gif image, the following appears in the
status bar
javascript:SetPlanID(document.forms[0].selPlan.value, 'false');

The url of the page with the gif image is
https://p32web.mercerhrs.com/abc/PM/pm_welcome.asp

The url of the page you get to when you manually click the image is
https://p32web.mercerhrs.com/abs/PM/pm_welcome.asp

the source code that is relevant to the gif image is

<!--Begin Body-->
<form name="frmWelcome" method="post">
<input type="hidden" name="hdnDisplay" value="TRUE" />
<input type="hidden" name="Plan" value />
<input type="hidden" name="RetirementOnline" value="false" />

<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td colspan="2">

<!-- Multiplan Calculation Link -->
<table cellpadding="0" cellspacing="0" border="0" width="586">

<tr valign="top">
<td width="283">

<div class="round">
<div class="content">

<h2>If you would like to estimate your pension, you can do so now.</
h2>

<span style="FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #000000;
FONT-FAMILY: Times New
Roman">RGA Plan</span>

<input type="hidden" name="selPlan" value="RGA||RGA Plan" />

<input type="hidden" name="currPlanIdx" value="1" />

<a href="javascript:SetPlanID(document.forms[0].selPlan.value,
'false');"><img src
="images/button_estimatepension.gif" alt width="149" height="15" /

</div>

<div class="round-bottom">&nbsp;</div>

</div>

I've tried to submit the form, I've tried to click the gif image, all
without success. I assume I need to use some VBA code like
ie.navigate "url"

I've tried to construct the appropriate url, but have not been
successful with this approach either. Any help would be appreciated.
Failing an answer, if anyone knows of a javascript group where I might
try reposting, that would be helpful too...TIA, Ron
 
T

Tim Williams

It would help to post the code you have so far.
Assuming "IE" is your reference to InternetExplorer:

'********************
Dim i As Object
For Each i In IE.document.images
If i.src Like "*button_estimatepension.gif" Then i.Click
Next i
'********************

Tim

ron said:
I'm trying to access a web page so that I can collect and process the
data back in Excel. Unfortunately the page preceding it is password
protected, so you won't be able to view the page first-hand. In any
case, the page I'm stuck on contains a gif image that needs to be
clicked in order to proceed to the desired page with the data. I
can't figure out how to get beyond this page with the gif image. Here
is some information.

When the cursor moves over the gif image, the following appears in the
status bar
javascript:SetPlanID(document.forms[0].selPlan.value, 'false');

The url of the page with the gif image is
https://p32web.mercerhrs.com/abc/PM/pm_welcome.asp

The url of the page you get to when you manually click the image is
https://p32web.mercerhrs.com/abs/PM/pm_welcome.asp

the source code that is relevant to the gif image is

<!--Begin Body-->
<form name="frmWelcome" method="post">
<input type="hidden" name="hdnDisplay" value="TRUE" />
<input type="hidden" name="Plan" value />
<input type="hidden" name="RetirementOnline" value="false" />

<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td colspan="2">

<!-- Multiplan Calculation Link -->
<table cellpadding="0" cellspacing="0" border="0" width="586">

<tr valign="top">
<td width="283">

<div class="round">
<div class="content">

<h2>If you would like to estimate your pension, you can do so now.</
h2>

<span style="FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #000000;
FONT-FAMILY: Times New
Roman">RGA Plan</span>

<input type="hidden" name="selPlan" value="RGA||RGA Plan" />

<input type="hidden" name="currPlanIdx" value="1" />

<a href="javascript:SetPlanID(document.forms[0].selPlan.value,
'false');"><img src
="images/button_estimatepension.gif" alt width="149" height="15" /

</div>

<div class="round-bottom">&nbsp;</div>

</div>

I've tried to submit the form, I've tried to click the gif image, all
without success. I assume I need to use some VBA code like
ie.navigate "url"

I've tried to construct the appropriate url, but have not been
successful with this approach either. Any help would be appreciated.
Failing an answer, if anyone knows of a javascript group where I might
try reposting, that would be helpful too...TIA, Ron
 
R

ron

It would help to post the code you have so far.
Assuming "IE" is your reference to InternetExplorer:

'********************
Dim i As Object
For Each i In IE.document.images
    If i.src Like "*button_estimatepension.gif" Then i.Click
Next i
'********************

Tim




I'm trying to access a web page so that I can collect and process the
data back in Excel.  Unfortunately the page preceding it is password
protected, so you won't be able to view the page first-hand.  In any
case, the page I'm stuck on contains a gif image that needs to be
clicked in order to proceed to the desired page with the data.  I
can't figure out how to get beyond this page with the gif image.  Here
is some information.
When the cursor moves over the gif image, the following appears in the
status bar
javascript:SetPlanID(document.forms[0].selPlan.value, 'false');
The url of the page you get to when you manually click the image is
https://p32web.mercerhrs.com/abs/PM/pm_welcome.asp
the source code that is relevant to the gif image is
<!--Begin Body-->
  <form name="frmWelcome" method="post">
  <input type="hidden" name="hdnDisplay" value="TRUE" />
  <input type="hidden" name="Plan" value />
  <input type="hidden" name="RetirementOnline" value="false" />
  <table cellspacing="0" cellpadding="0" width="100%" border="0">
  <tr>
  <td colspan="2">
<!-- Multiplan Calculation Link -->
  <table cellpadding="0" cellspacing="0" border="0" width="586">
  <tr valign="top">
  <td width="283">
  <div class="round">
  <div class="content">
  <h2>If you would like to estimate your pension, you can do so now.</
h2>
  <span style="FONT-WEIGHT: bold; FONT-SIZE: 14px; COLOR: #000000;
FONT-FAMILY: Times New
     Roman">RGA Plan</span>
  <input type="hidden" name="selPlan" value="RGA||RGA Plan" />
  <input type="hidden" name="currPlanIdx" value="1" />
  <a href="javascript:SetPlanID(document.forms[0].selPlan.value,
'false');"><img src
    ="images/button_estimatepension.gif" alt width="149" height="15" /
  </div>
  <div class="round-bottom">&nbsp;</div>
  </div>
I've tried to submit the form, I've tried to click the gif image, all
without success.  I assume I need to use some VBA code like
ie.navigate "url"
I've tried to construct the appropriate url, but have not been
successful with this approach either.  Any help would be appreciated.
Failing an answer, if anyone knows of a javascript group where I might
try reposting, that would be helpful too...TIA, Ron- Hide quoted text -

- Show quoted text -

Thanks Tim, that solved my problem! I took it a step further and
identified images(16) as the image/button I wanted to click. The
following line of code now does the trick. Thanks again...Ron

ie.document.images(16).Click
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top