{"id":19448445,"url":"https://github.com/metaljase/seleniumcapturehttpresponse","last_synced_at":"2026-05-08T09:32:13.122Z","repository":{"id":154888892,"uuid":"451169921","full_name":"metaljase/SeleniumCaptureHttpResponse","owner":"metaljase","description":"Example of how to capture an HTTP response using Selenium WebDriver, ChromeDriver, Chrome DevTools Protocol, and C#.","archived":false,"fork":false,"pushed_at":"2026-05-03T23:41:45.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-04T01:26:20.406Z","etag":null,"topics":["chrome-devtools","chromedriver","csharp","dotnet","dotnet-core","dotnetcore","selenium","webdriver"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metaljase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-01-23T16:55:39.000Z","updated_at":"2026-05-03T23:41:46.000Z","dependencies_parsed_at":"2024-03-16T17:20:09.254Z","dependency_job_id":null,"html_url":"https://github.com/metaljase/SeleniumCaptureHttpResponse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/metaljase/SeleniumCaptureHttpResponse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaljase%2FSeleniumCaptureHttpResponse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaljase%2FSeleniumCaptureHttpResponse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaljase%2FSeleniumCaptureHttpResponse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaljase%2FSeleniumCaptureHttpResponse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metaljase","download_url":"https://codeload.github.com/metaljase/SeleniumCaptureHttpResponse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaljase%2FSeleniumCaptureHttpResponse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32774753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome-devtools","chromedriver","csharp","dotnet","dotnet-core","dotnetcore","selenium","webdriver"],"created_at":"2024-11-10T16:26:50.789Z","updated_at":"2026-05-08T09:32:13.115Z","avatar_url":"https://github.com/metaljase.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What's SeleniumCaptureHttpResponse?\nSeleniumCaptureHttpResponse contains two C# .NET 8 console apps that demonstrate how to capture a HTTP responses using Selenium WebDriver, ChromeDriver, and Chrome DevTools Protocol (CDP).  It is not a standalone application, it's a working example of how you can capture HTTP responses (e.g. JSON from API calls) on web pages, inc. 3rd party websites.  Therefore, you'll need software to compile the code, e.g. Visual Studio 2026.\n\n## What's Selenium WebDriver?\n[Selenium](https://www.selenium.dev) WebDriver controls compatible web browsers (inc. Firefox, Chrome, Edge, Internet Explorer) natively, as a real user would.  [Selenium .NET API documentation](https://www.selenium.dev/selenium/docs/api/dotnet/index.html) can be found on their website.\n\n## What's ChromeDriver?\n[ChromeDriver](https://sites.google.com/chromium.org/driver/) is an executable that Selenium WebDriver uses to control Chrome.\n\n## What's Chrome DevTools Protocol?\n[Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) (CDP) allows for tools to instrument, inspect, debug, and profile, Chromium, Chrome, and other Blink-based browsers.  SeleniumCaptureHttpResponse uses CDP to capture HTTP responses.\n\n## Where could this be useful?\nTesting a web page for bugs or as part of scraping a web page where capturing HTTP traffic is desired.\n\n## What's the difference between the two console apps?\n`Metalhead.SeleniumCaptureHttpResponse.Selenium4` uses Selenium 4 to capture HTTP responses.\n`Metalhead.SeleniumCaptureHttpResponse.CDP` uses Selenium and Chrome DevTools Protocol to capture HTTP responses.  CDP gives you more control than Selenium 4, but it is also more complex to set up and use.\n\n## Setup instructions\n1. Install the Chrome web browser.\n2. Download the version of ChromeDriver that matches your version of Chrome.  If don't need the [latest version of ChromeDriver](https://googlechromelabs.github.io/chrome-for-testing/), then [older versions](https://chromedriver.chromium.org/downloads) are available.  Note: 32-bit version works with 64-bit Chrome.\n3. Clone the SeleniumCaptureHttpResponse repository.\n4. Open the .NET solution in Visual Studio 2026 (or a compatible alternative).\n5. Open the `appsettings.json` file and edit the paths to match the location of Chrome and ChromeDriver on your PC.  Note: If you set these paths to `null`, then the code will use the default locations for Chrome and ChromeDriver.\n6. Build the solution and run!\n\nThis should open Chrome and automatically visit [my example web page](https://metaljase.github.io/SeleniumCaptureHttpResponse.html).  The JavaScript in that web page makes two API calls, returning [users](https://jsonplaceholder.typicode.com/users/) and [albums](https://jsonplaceholder.typicode.com/albums/) data as JSON in the HTTP responses.\nThe code in `CaptureResponse.cs` captures the HTTP responses, stores the JSON from the message body, then outputs the JSON in the console window.  In a real use case, you'll probably do something more exciting with the HTTP response!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaljase%2Fseleniumcapturehttpresponse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetaljase%2Fseleniumcapturehttpresponse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaljase%2Fseleniumcapturehttpresponse/lists"}