Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Control Chrome programmatically

Is it possible to control and instantiate a Chrome browser from C#? Things like opening a new window, changing the URL, reloading the tabs, etc.

I've had a look for a C# Chrome API but can only find a Javascript ones on https://developer.chrome.com/, and the best I could find here was C# - How to control chrome browser - the best answer was to check out the API.

like image 422
Sam0 Avatar asked Feb 08 '17 18:02

Sam0


3 Answers

There is an API available for that. It's called 'Selenium', and has a Chrome-specific third party extension.

http://www.seleniumhq.org/

Check that link.

like image 152
Abiezer Avatar answered Nov 08 '22 07:11

Abiezer


Doing a quick Google search for "chrome C# api" turned up some results I think you may like to consider

I thought the following were particularly promising, if you're willing to accept the concession of using Chrome's developer tools:

  • Automating Chrome Browser from C#
  • ChromeDevTools; a C# Library to interact with Chrome's Developer Tools
  • Chrome Debugging API
like image 38
TernaryTopiary Avatar answered Nov 08 '22 05:11

TernaryTopiary


Are you looking for something like CEF Sharp?

It's an open source project that allows you to embed Chrome into your .NET application. So you can have those C# controls interact with the browser.

like image 3
Sunny Patel Avatar answered Nov 08 '22 05:11

Sunny Patel