Skip to content

Commit 01fd45a

Browse files
committed
Fix edge driver version and url getters. Update unzip method
1 parent ca6d706 commit 01fd45a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

WebDriverManager/DriverConfigs/Impl/EdgeConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public string GetLatestVersion()
3434
var htmlCode =
3535
client.DownloadString("https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver");
3636
doc.LoadHtml(htmlCode);
37-
var itemList = doc.DocumentNode.SelectNodes("//*[@class='driverConfig-download']/p")
37+
var itemList = doc.DocumentNode.SelectNodes("//*[@class='driver-download']/p")
3838
.Select(p => p.InnerText).ToList();
3939
var version = itemList.FirstOrDefault()?.Split(' ')[1].Split(' ')[0];
4040
return version;
@@ -49,7 +49,7 @@ public static string GetUrl()
4949
var htmlCode =
5050
client.DownloadString("https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver");
5151
doc.LoadHtml(htmlCode);
52-
var itemList = doc.DocumentNode.SelectNodes("//*[@class='driverConfig-download']/a")
52+
var itemList = doc.DocumentNode.SelectNodes("//*[@class='driver-download']/a")
5353
.Select(p => p.GetAttributeValue("href", null)).ToList();
5454
var url = itemList.FirstOrDefault();
5555
return url;

WebDriverManager/Services/Impl/BinaryService.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.IO;
1+
using System;
2+
using System.IO;
23
using System.IO.Compression;
34
using System.Net;
45
using WebDriverManager.Helpers;
@@ -29,6 +30,12 @@ protected string DownloadZip(string url, string destination)
2930

3031
protected string UnZip(string path, string destination, string name)
3132
{
33+
var zipName = Path.GetFileName(path);
34+
if (zipName != null && zipName.Equals(name, StringComparison.CurrentCultureIgnoreCase))
35+
{
36+
File.Copy(path, destination);
37+
return destination;
38+
}
3239
using (var zip = ZipFile.Open(path, ZipArchiveMode.Read))
3340
{
3441
foreach (var entry in zip.Entries)

0 commit comments

Comments
 (0)