MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / get_chrome_milestone

Function get_chrome_milestone

scripts/update_cdp.py:19–43  ·  view source on GitHub ↗

Get the Chrome milestone from the channel. This is the same method from pinned_browser.

()

Source from the content-addressed store, hash-verified

17
18
19def get_chrome_milestone():
20 """Get the Chrome milestone from the channel.
21
22 This is the same method from pinned_browser.
23 """
24 parser = argparse.ArgumentParser()
25 parser.add_argument("--chrome_channel", default="Stable", help="Set the Chrome channel")
26 args = parser.parse_args()
27 channel = args.chrome_channel
28
29 r = http.request(
30 "GET",
31 "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json",
32 )
33 milestone = json.loads(r.data)["channels"][channel]["version"].split(".")[0]
34 r = http.request(
35 "GET",
36 "https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json",
37 )
38 versions = json.loads(r.data)["versions"]
39
40 return max(
41 filter(lambda v: v["version"].split(".")[0] == str(milestone), versions),
42 key=lambda v: parse(v["version"]),
43 )
44
45
46def github_get(url):

Callers 1

update_cdp.pyFile · 0.85

Calls 5

filterFunction · 0.85
splitMethod · 0.80
parseFunction · 0.50
add_argumentMethod · 0.45
requestMethod · 0.45

Tested by

no test coverage detected