Jump to content

[Solved] IETagNameGetCollection


Recommended Posts

The problem that I am having is when my Msgbox pops up it come up blank.

I would like it to show Nonprocedure.  

Why is my msgbox coming up blank?

How do I grab NonProcedure code and display it  in msgbox. 

Do
   $oInputs = _IETagNameGetCollection($oIE,"class")
   For  $oInput in $oInputs
   If StringStripWS($oInput.innertext,1) = "medical__name" Then
     $otarget = $oInput
     $vTxt = $otarget.
      ExitLoop
   Else
      $target = "1"
   EndIf
Next

Until $otarget <> "1"


MsgBox(0,"",$vTxt)





<div class="medical__summary">
      <a class="medical__name" onclick="trackmedicalEvent('medicalClick', 'click', '4990000', '82546', 'tri', 1, '');" href="/field/origin/a/xid=i5dbe04e5d2ac4ad58ea5bdb7049b1af7">NonProcedure</a>
      <a class="medical__group" href="/field/origin">Origin <span class="medical__category-name">(medical)</span></a>
      <div class="medical__extended-fields">
            <span class="medical__extended-field">Number 319390</span>
            <span class="medical__extended-field">Type</span>
      </div>
</div>

 

Edited by SkysLastChance

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

13 minutes ago, SkysLastChance said:

     $vTxt = $otarget.

You need to add innerText or something after and class is not a tag, use "a" instead and compare with object.className

Edited by Nine
Link to comment
Share on other sites

That did the trick. Thank you so much!

Do
   $oInputs = _IETagNameGetCollection($oIE,"a")
   For  $oInput in $oInputs
   If StringStripWS($oInput.classname,1) = "medical__name" Then
     $otarget = $oInput
     $vTxt = $otarget.innertext
      ExitLoop
   Else
      $target = "1"
   EndIf
Next

Until $otarget <> "1"


MsgBox(0,"",$vTxt)

@NineHow can I better understand when I can and can't use  .innertext and .classname? 

Edited by SkysLastChance

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

44 minutes ago, SkysLastChance said:

How can I better understand when I can and can't use  .innertext and .classname?

Reading about HTML woudn't hurt.  But the difference is quite simple for those 2.  .classname is when there is class=something. .innertext is typically set at the end of a tag. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...