Jump to content

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

Life's simple. You make choices and you don't look back.

Share this post


Link to post
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

Life's simple. You make choices and you don't look back.

Share this post


Link to post
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. 

Share this post


Link to post
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

  • Similar Content

    • By moimon
      Hi all. 
      Sorry if my words are confusing because I am not good at English.
      I am writing code to embed website with Recaptcha in GUI. And then, the code will automatically press the "I'm not a robot" button. The problem here is:
         - The code still works fine when entering iFrame to interact with Recaptcha with the URL is "https://www.google.com/recaptcha/api2/demo"
      <snip>
       
         - But for other URLs (such as "https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php"), the code cannot be entered into the iframe.
       
      Code:
      <snip>  
      I did a lot of research but didn't know why.
       I sincerely thanks for the help. 
    • By SkysLastChance
      I am pretty sure the site that I am using was updated and now I am not seeing the same tags/elements that I used to. I tried using a UIAspy to see if I could grab them that way with no luck. 
      What do I need to do to be able to automate this again. Are the elements hidden somewhere?
      Instead of highlighting established account is highlights all of the web page almost. How can I get to the detail again? 
      I used to grab establish account by the name. Now I have nothing to even try to grab. 
      There are not elements in the event viewer either. 
       


       
      This is what happens when I try to inspect the element and click established account. 
      I get the same type of results in chrome
    • By yffulf
      Is there probably a way to click ie popup button and hide or invisible popup button in the same time?
      I try to use WinSetState @SW_hide ,
      the result is ie crashing or no response because button hide and the next click command won't work...
      $oForm=_IEFormGetObjByName($oIE,"form1") $obutton=_IEFormElementGetObjByName($oForm,"btn_OK") $hWnd = _IEPropertyGet($oIE, "hwnd") _IEAction($obutton,"focus") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") WinWait("", "確定存檔嗎?") WinSetState("","確定存檔嗎?",@SW_Hide) ControlClick("", "確定存檔嗎?", "[CLASS:Button; TEXT:確定; Instance:1;]")  
    • By _leo_
      Hey there!
      I am having a problem with clicking a button in IE. As you can see in the code, there would be a class name to click it, but since this button exists several times with exactly the same code, I can only use the "Noch nicht veröffentlicht" to separate it from the others. But this part is just pure text without any classification. 
      "<div class="checkmark" data-v-1e5b1f70=""><svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 16 16" data-v-1e5b1f70=""><circle cx="8" cy="8" r="8" data-v-1e5b1f70="" /></svg></div>Noch nicht veröffentlicht"
      I was trying to click it with:
      #include <IE.au3> local $oNNVs = _IEFormGetCollection($oIE2) For $oNNV in $oNNVs If String($oNNV.innertext) = "Noch nicht veröffentlicht" Then _IEAction($oNNV, "click") EndIf Next and:
      $inputs = $oIE2.document.getElementsByTagName("div") For $input In $inputs If $input.innertext == "Noch nicht veröffentlicht" then $input.click() EndIf Next But nothing seems to work. Thanks for the help!
    • By TXTechie
      Hello Everyone,
      I'm looking for a way to use an already open Internet Explorer (IE) window (if one is up and running) and then navigate to a new URL in a new IE tab.
      I thought that _IECreate would easily meet my needs. However, when I use the following script:
      #include <IE.au3> Local $oIE = _IECreate("https://" & $Server & ":8444/", 1, 1, 0, 1) ...with one or more open IE windows, it still opens yet a new IE window.
      Are there any other ideas for how to reliably use an already open IE windows and then how to open a new tab in IE to navigate to a new URL?
      Regards,
      TX Techie
×
×
  • Create New...