Created
December 21, 2019 18:38
-
-
Save rehannali/8ee60d9866aa78f268f9272fd46a6250 to your computer and use it in GitHub Desktop.
Get categories from Jackett index
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
from bs4 import BeautifulSoup | |
with open("/Users/rehan/Documents/iOS Projects/Developers Clan/abc.html", "r") as file: | |
html_doc = file.read() | |
categories_arr = [] | |
html_parser = BeautifulSoup(html_doc, "lxml") | |
all_td_tags = html_parser.find_all("td") | |
for tag in all_td_tags: | |
tag_text = tag.get_text() | |
if tag_text.isdigit(): | |
categories_arr.append(tag_text) | |
print(",".join(categories_arr)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment