Skip to content

Instantly share code, notes, and snippets.

@rehannali
Created December 21, 2019 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rehannali/8ee60d9866aa78f268f9272fd46a6250 to your computer and use it in GitHub Desktop.
Save rehannali/8ee60d9866aa78f268f9272fd46a6250 to your computer and use it in GitHub Desktop.
Get categories from Jackett index
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