This repository has been archived by the owner on Apr 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make script that calculates all supported devices
- Loading branch information
1 parent
fb0c3e1
commit f71f305
Showing
2 changed files
with
70 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import requests | ||
from bs4 import BeautifulSoup, NavigableString | ||
|
||
# Download the page | ||
page = requests.get("https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/") | ||
|
||
soup = BeautifulSoup(page.content, 'html.parser') | ||
table = soup.find_all("table")[-1] | ||
|
||
SupportedBoards = ["nami", "octopus", "volteer", "coral", "reef", "hatch", "puff"] | ||
|
||
for child in table.children: | ||
try: | ||
#print(child.contents) | ||
if child.contents[11].text.strip().lower() in SupportedBoards: | ||
# Newlines count as elements, so we use 5 instead of 3 | ||
nameElement = child.contents[5] | ||
name = nameElement.a.text.strip() | ||
if name != "": | ||
print(f"* {name}") | ||
except AttributeError: | ||
continue |