om4r932 commited on
Commit
5938f28
·
1 Parent(s): 3b1ec5d
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -409,7 +409,17 @@ class SpecDocFinder:
409
  today = datetime.today()
410
  output = {"specs": self.indexer_specs, "scopes": self.indexer_scopes, "last_indexed_date": self.last_indexer_date}
411
  json.dump(output, f, indent=4, ensure_ascii=False)
412
-
 
 
 
 
 
 
 
 
 
 
413
  def search_document(self, document, release):
414
  series = document.split(".")[0].zfill(2)
415
  url = f"https://www.3gpp.org/ftp/Specs/archive/{series}_series/{document}"
 
409
  today = datetime.today()
410
  output = {"specs": self.indexer_specs, "scopes": self.indexer_scopes, "last_indexed_date": self.last_indexer_date}
411
  json.dump(output, f, indent=4, ensure_ascii=False)
412
+
413
+ def get_docs_from_url(self, url):
414
+ """Get list of documents/directories from a URL"""
415
+ try:
416
+ response = requests.get(url, verify=False, timeout=10)
417
+ soup = BeautifulSoup(response.text, "html.parser")
418
+ return [item.get_text() for item in soup.select("tr td a")]
419
+ except Exception as e:
420
+ print(f"Error accessing {url}: {e}")
421
+ return []
422
+
423
  def search_document(self, document, release):
424
  series = document.split(".")[0].zfill(2)
425
  url = f"https://www.3gpp.org/ftp/Specs/archive/{series}_series/{document}"