instantiate chrome object in powershell

后端 未结 3 1805
刺人心
刺人心 2020-12-24 14:02

I have a powershell script which works just fine in IE however I need to also have it work in Chrome. $ie = new-object -com \"InternetExplorer.Application\" Works fine for I

相关标签:
3条回答
  • 2020-12-24 14:42

    You can start a process by name and even pass it a parameter, like this:

    Start-Process "chrome.exe" "www.google.com"
    
    0 讨论(0)
  • 2020-12-24 14:54

    I Have tested this link and it works.

    Different ways to open application/programs in powershell

    0 讨论(0)
  • 2020-12-24 14:57

    if you are fine with a 3rd party dll you could use Selenium which has also a Chromdriver, that gives you the same kind of control over Chrome as through InternetExplorer.Application COM

    Selenium webpage

    There is also a PowerShell wrapper for Selenium available on CodePlex

    http://sepsx.codeplex.com/

    0 讨论(0)
提交回复
热议问题