I'm looking for a link to get the latest driver version number for Microsoft Edge similar to Google Chrome's link: https://chromedriver.storage.googleapis.com/LATEST_RELEASE
I have a function to return a string of the version number. Then, I can create a download link like so:
private String getLatestChromeDriverVersion(){
RestTemplate restTemplate = new RestTemplate();
String url = "https://chromedriver.storage.googleapis.com/LATEST_RELEASE";
return restTemplate.getForObject(url, String.class);
}
String chromeDownloadUrl = "https://chromedriver.storage.googleapis.com/" + getLatestChromeDriverVersion() + "/chromedriver_win32.zip";
I've been searching around for something similar for Edge, but I can't find anything. They have this page for downloading the driver: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ but nothing like /latest or /stable.
Any ideas?
You can get the latest version number that has been given in the official documentation via these two links:
https://msedgedriver.azureedge.net/LATEST_STABLE
and
https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/LATEST_STABLE
Note: They all return a file instead of directly returning a version number like chrome, you need to get the version number from this file.
A simple demo:
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://msedgedriver.azureedge.net/LATEST_STABLE"))
.build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
String version = response.body().replaceAll("[^\\d|.]", "");
System.out.println(version);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With