none
Find a string and then innitiate mouse click on it RRS feed

  • Question

  • I'm trying to open a website where I only know the URL for the main page. So I have a script to open Internet Explorer and navigate to that website however after I would like the script to find a specific String "File". This string can be found twice. Once as "File" and once in the "Profile" word, so what I need is to find the exact String "File" and then click on it, it would open a javascript menu where again it should find another specific string "Incident..." and open the link behind it.

    Hope I was clear.

    The script I have will open the browser navigate to the website, but can not make it to find the keyword and initiate the click event, could you help me with that?

    I have the following code so far:

    Set ie = WScript.CreateObject("InternetExplorer.Application")
    
    ie.ToolBar = 1
    ie.StatusBar = 0
    ie.Width = 800
    ie.Height = 600
    ie.Visible = 1
    Do While ie.Busy: Loop
    ie.Navigate("https://site link")
    WScript.Sleep 1000
    
    For Each a In IE.Document.GetElementsByTagName("")
    If LCase(a.href = LCase("File")) Then
    a.Click
    Exit For  
    End If
    Next

    Wednesday, March 27, 2019 3:30 PM

Answers

  • Hello,

    For the record there is no Microsoft forum for WScript, this forum is for VB.NET. Consider asking in the following forum

    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by kocsism Wednesday, March 27, 2019 3:52 PM
    Wednesday, March 27, 2019 3:47 PM
    Moderator

All replies

  • Hello,

    For the record there is no Microsoft forum for WScript, this forum is for VB.NET. Consider asking in the following forum

    https://social.technet.microsoft.com/Forums/scriptcenter/en-US/home?forum=ITCG


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by kocsism Wednesday, March 27, 2019 3:52 PM
    Wednesday, March 27, 2019 3:47 PM
    Moderator
  • All right, I'm sorry and thank you for the info.
    Wednesday, March 27, 2019 3:52 PM
  • All right, I'm sorry and thank you for the info.
    No reason to be sorry, it's not readily apparent this forum was not the right forum :-)

    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Wednesday, March 27, 2019 4:44 PM
    Moderator