VBA excel find value from HTML inside javascript element to open new ie window

smithcorya

New Member
Joined
Aug 31, 2012
Messages
8
I have a webpage with an agravating amount of javascript within the HTML code. I can view the source and find the objectID=xxxxx.xxxxx.xxxxx.xxxxx value that i need to use. I want to use the value to open a final webpage directly. I am doing this to avoid opening several pages with sendkeys.

I have tried document.body.innerHTML document.innerHTML and outerHTML on both and I can't get the full code to parse the result.
I have tried to search by element and had no luck (I have not properly been able to find any elements)

I can right click in the page in two places and click on copy shortcut and extract the links where the tag I need is listed. I don't have the skills to get the value into a variable in VBA.

Can someone shed some light on this for me? I'm stuck.

HTML:
 ********>strPageIDs += "10007.24273.17721.11501" + "~";*********>Generic Request 
                                      33102-1

How do I find this long number in the code and hold it in a variable or see it via debug so I can make use of it?</TBODY></TABLE>
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Why do you need to find that number?

What is it you are trying to use to get to the other page?

A button, a link, an image?

If you want to find specific elements or collections of elements you can use getElementByID and getElementsByTagName, among others.
 
Upvote 0
Why do you need to find that number?

What is it you are trying to use to get to the other page?

A button, a link, an image?

If you want to find specific elements or collections of elements you can use getElementByID and getElementsByTagName, among others.


I trying to directly open a formatted print preview web page of the document I want.

Option 1 - open three windows with multiple frames using a link on the page and sendkeys
This option - I have the formatted javascript call to get the print preview page directly. I just need to insert the proper document number in the url and use ie.navigate to open it.

I have tried getelements different ways but have not been successful. Most likely because I am not applying the code properly. I have been trying to apply code found on the net but I have not been successful. I would like to understand how to cycle through all the elements and see the result in debug.print immediate window and see if this tag will come up in the list. I need help with the code. Once I can view the list of all code then I would need to decide how to search for the exact one I need.
 
Upvote 0
What type of element is it you are looking for?
 
Upvote 0
Code:
                  <th> 
 
</th>
 
</tr>
<tr class="even"><td style="text-align: center"><input type="checkbox" name="emxTableRowId" value="10007.24273.17721.11501" *******="doCheckboxClick(this); doSelectAllCheck(this)">********>strPageIDs += "10007.24273.17721.11501" + "~";*********></td><td>Generic Request </td><td><table border="0">
                                    <tr><td valign="top"><a href="JavaScript:emxTableColumnLinkClick('../components/emxInfoManagedMenuEmxTree.jsp?emxSuiteDirectory=components&relId=null&parentOID=null&jsTreeID=null&suiteKey=Components&objectId=10007.24273.17721.11501', '', '', 'false', 'content', 'Show Content')"  class="object"><img border="0" src="images/iconSmallSCO.gif"></a></td><td> <a href="JavaScript:emxTableColumnLinkClick('../components/emxInfoManagedMenuEmxTree.jsp?emxSuiteDirectory=components&relId=null&parentOID=null&jsTreeID=null&suiteKey=Components&objectId=10007.24273.17721.11501', '', '', 'false', 'content', 'Show Content')" class="object">33102-1</a> </td></tr>
maybe i could use name element to get the value listed for the checkbox
or I could use the type="checkbox" to get the value.
input type="checkbox" name="emxTableRowId" value="10007.24273.17721.11501"
 
Upvote 0
maybe i could use name element to get the value listed for the checkbox

or I could use the type="checkbox" to get the value.

input type="checkbox" name="emxTableRowId" value="10007.24273.17721.11501"
 
Upvote 0
maybe i could use name element to get the value listed for the checkbox

or I could use the type="checkbox" to get the value.

input type="checkbox" name="emxTableRowId" value="10007.24273.17721.11501"
 
Upvote 0
Code:
</tr>
<tr class="even"><td style="text-align: center"><input type="checkbox" name="emxTableRowId" value="10007.24273.17721.11501" *******="doCheckboxClick(this); doSelectAllCheck(this)">********>strPageIDs += "10007.24273.17721.11501" + "~";*********></td><td>Generic Request </td><td><table border="0">
                                    <tr><td valign="top"><a href="JavaScript:emxTableColumnLinkClick('../components/emxInfoManagedMenuEmxTree.jsp?emxSuiteDirectory=components&relId=null&parentOID=null&jsTreeID=null&suiteKey=Components&objectId=10007.24273.17721.11501', '', '', 'false', 'content', 'Show Content')"  class="object"><img border="0" src="images/iconSmallSCO.gif"></a></td><td> <a href="JavaScript:emxTableColumnLinkClick('../components/emxInfoManagedMenuEmxTree.jsp?emxSuiteDirectory=components&relId=null&parentOID=null&jsTreeID=null&suiteKey=Components&objectId=10007.24273.17721.11501', '', '', 'false', 'content', 'Show Content')" class="object">33102-1</a> </td></tr>
 
                                </table>
 
Upvote 0
maybe i could use name element to get the value listed for the checkbox

or I could use the type="checkbox" to get the value.

input type="checkbox" name="emxTableRowId" value="10007.24273.17721.11501"
 
Upvote 0

Forum statistics

Threads
1,223,631
Messages
6,173,465
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top