Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Using wildcards to find innertext


  • Please log in to reply
1 reply to this topic
Typ0
  • Members
  • 3 posts
  • Last active: Mar 07 2014 08:17 PM
  • Joined: 27 Feb 2014

Hi All,

 

I am a relative noobie.  Here is the problem I am facing.  On an internal website of my company there is a REQ number i want to obtain.  This normally requires me to click a link then manually highlight and copy it.

 

I want to rip it directly from the innertext without having to launch that annoying slow pop up.

 

I have had success with commands such as..

 

rwb := WBGet("BMC")

REQ := rwb.document.all[2021].innertext

MsgBox % REQ

 

However the problem lies in the fact that the [2021] index location changes each time the frame loads.  Does anyone know any alternate solutions to this problem?

 

One potential solution I thought of was to loop through the index locations and look for the string REQ.  The problem here is I dont know how to use wildcards to include the random numbers that come afterwards.  I also am not sure how to set up a proper loop,  A full REQ number looks like REQ92390329 so I need a wildcard command along the lines of REQ*********.

 

So basically what I want to do is loop through the innertexts until I find the "REQ#########" number and copy that to a variable called REQ.



MulMan
  • Members
  • 31 posts
  • Last active: Aug 04 2015 07:45 PM
  • Joined: 06 Jul 2011

Use a loop to get the value in each location, but instead of a wild card, use "IfInString, var, REQ" to find it.