Created
January 23, 2026 23:07
-
-
Save terremoth/bc3d423e79e987d122d4605936882dcf to your computer and use it in GitHub Desktop.
Filter API's with no CORS neither Authentication from https://github.com/public-apis/public-apis
This file contains hidden or 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
| from bs4 import BeautifulSoup | |
| with open("input.html", "r", encoding="utf-8") as f: | |
| soup = BeautifulSoup(f, "html.parser") | |
| for table in soup.find_all("table"): | |
| tbody = table.find("tbody") | |
| if not tbody: | |
| continue | |
| for row in tbody.find_all("tr"): | |
| cols = [td.get_text(strip=True).lower() for td in row.find_all("td")] | |
| if len(cols) < 5: | |
| row.decompose() | |
| continue | |
| auth = cols[2] | |
| cors = cols[4] | |
| if not (auth == "no" and cors == "no"): | |
| row.decompose() | |
| with open("output.html", "w", encoding="utf-8") as f: | |
| f.write(str(soup)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment