Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

instantiate chrome object in powershell

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 IE. How do I instantiate the Chrome browser?

like image 606
user2874251 Avatar asked Oct 14 '13 15:10

user2874251


2 Answers

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

Start-Process "chrome.exe" "www.google.com"
like image 108
Jim Avatar answered Oct 16 '22 18:10

Jim


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/

like image 4
Dirk Avatar answered Oct 16 '22 17:10

Dirk