【问题标题】:Is there a link to get the latest Microsoft Edge version number?是否有获取最新 Microsoft Edge 版本号的链接?
【发布时间】:2023-01-07 22:11:35
【问题描述】:

我正在寻找一个链接来获取 Microsoft Edge 的最新驱动程序版本号,类似于 Google Chrome 的链接:https://chromedriver.storage.googleapis.com/LATEST_RELEASE

我有一个返回版本号字符串的函数。然后,我可以像这样创建一个下载链接:

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";

我一直在四处寻找与 Edge 类似的东西,但找不到任何东西。他们有这个用于下载驱动程序的页面:https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ 但没有像 /latest 或 /stable 这样的东西。

有任何想法吗?

【问题讨论】:

  • 似乎 MS 版本号基于不同平台的不同版本,即 Android 的最新版本可能与 Windows 的最新版本共享相同的版本号,请参见en.wikipedia.org/wiki/Microsoft_Edge 的示例
  • 我可以知道你是否有机会检查我的答案吗?如果您有任何其他问题,我很乐意提供帮助。

标签: java spring-boot rest webdriver microsoft-edge


【解决方案1】:

您可以通过以下两个链接获取官方文档中给出的最新版本号:

https://msedgedriver.azureedge.net/LATEST_STABLE

https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/LATEST_STABLE

笔记: 都是返回一个文件,而不是像chrome一样直接返回一个版本号,需要从这个文件中获取版本号。

一个简单的演示:

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);

【讨论】:

    【解决方案2】:

    彭旭东的回答是正确的。 我只想补充一点,您可以通过此链接获取某个主要版本的最新版本:

    https://msedgewebdriverstorage.blob.core.windows.net/edgewebdriver/LATEST_RELEASE_<MAJOR_VERSION>
    

    它将再次返回一个文件,您需要解析该文件以获得最新版本。

    如果您的 Edge 浏览器不是最新版本并且您想检索该版本的最新 geckodriver,这将很有用。

    【讨论】:

      【解决方案3】:

      您可以获得最新的 Edge 版本作为 JSON。它具有每个平台和架构的按渠道(产品)分类的最新版本。

      消费者构建:(Windows、MacOS、Linux、Android、IOS)

      https://edgeupdates.microsoft.com/api/products
      

      企业构建:(Windows、MacOS、Linux、GPO 策略文件)

      https://edgeupdates.microsoft.com/api/products?view=enterprise
      

      构建分为渠道(稳定版、测试版、开发版、金丝雀版)

      例子:

      {
              "Product": "Dev",
              "Releases": [
                  {
                      "ReleaseId": 43248,
                      "Platform": "MacOS",
                      "Architecture": "universal",
                      "CVEs": [],
                      "ProductVersion": "110.0.1587.2",
                      "Artifacts": [
                          {
                              "ArtifactName": "pkg",
                              "Location": "https://officecdnmac.microsoft.com/pr/03adf619-38c6-4249-95ff-4a01c0ffc962/MacAutoupdate/MicrosoftEdgeDev-110.0.1587.2.pkg",
                              "Hash": "046BB1322257530A66BCCEC6E821F2548163BEC1818C85B6FEB1E986DB62EBC0",
                              "HashAlgorithm": "SHA256",
                              "SizeInBytes": 352551023
                          },
                          {
                              "ArtifactName": "plist",
                              "Location": "https://officecdnmac.microsoft.com/pr/03adf619-38c6-4249-95ff-4a01c0ffc962/MacAutoupdate/MicrosoftEdgeDev-110.0.1587.2.plist",
                              "Hash": "4C8EB411D4A93FB721FF7A90031C95D696E97BB2D9051C48501C0BEB12AFBB19",
                              "HashAlgorithm": "SHA256",
                              "SizeInBytes": 3053
                          }
                      ],
                      "PublishedTime": "2023-01-05T19:43:00",
                      "ExpectedExpiryDate": "2023-04-05T19:43:00"
                  },
                  {
                      "ReleaseId": 43170,
                      "Platform": "Windows",
                      "Architecture": "x64",
                      "CVEs": [],
                      "ProductVersion": "110.0.1587.1",
                      "Artifacts": [
                          {
                              "ArtifactName": "msi",
                              "Location": "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/4de84b50-b3a8-4751-afb8-73812bce8713/MicrosoftEdgeDevEnterpriseX64.msi",
                              "Hash": "4DC76967D9BA3BFDB275B8D40AE3A9ED7F77C661879BFC1CD6C4264EBDC09540",
                              "HashAlgorithm": "SHA256",
                              "SizeInBytes": 147148800
                          }
                      ],
                      "PublishedTime": "2023-01-04T20:22:00",
                      "ExpectedExpiryDate": "2023-04-04T20:22:00"
                  }
              ]
          }
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-06-19
        • 1970-01-01
        • 2018-02-14
        • 2019-06-24
        • 2010-12-05
        • 1970-01-01
        • 1970-01-01
        • 2010-10-15
        相关资源
        最近更新 更多