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

Function get_chrome_milestone

scripts/update_cdp.py:17–42  ·  view source on GitHub ↗

Get the Chrome milestone from the channel. This is the same method from pinned_browser. Use --chrome_channel=Beta if using early stable release.

()

Source from the content-addressed store, hash-verified

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

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