Get the latest EdgeDriver version for a given major version and platform.
(major, platform)
| 211 | |
| 212 | |
| 213 | def get_edgedriver_version(major, platform): |
| 214 | """Get the latest EdgeDriver version for a given major version and platform.""" |
| 215 | platform_suffix = "LINUX" if platform == "linux" else "MACOS" |
| 216 | r = http.request( |
| 217 | "GET", |
| 218 | f"https://msedgedriver.microsoft.com/LATEST_RELEASE_{major}_{platform_suffix}", |
| 219 | ) |
| 220 | if r.status != 200: |
| 221 | return None |
| 222 | return r.data.decode("utf-16").strip() |
| 223 | |
| 224 | |
| 225 | def get_edgedriver_url(version, platform): |
no test coverage detected