From 1513e4ed67b151fad3048caeec4709a32b17e3d4 Mon Sep 17 00:00:00 2001 From: Sushant Bansal Date: Fri, 25 Sep 2020 17:46:29 -0500 Subject: [PATCH] Fixed file server parser to work with new file server --- web/project/util.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/project/util.py b/web/project/util.py index 602acea4..fc2f149d 100644 --- a/web/project/util.py +++ b/web/project/util.py @@ -117,11 +117,11 @@ def fetchForTreeFromHttp(self): """ page = requests.get(self.__path, headers=self.__headers, verify=False) tree = html.fromstring(page.content) - for xtag in tree.xpath('//li/a'): - file = xtag.text_content().strip() - if 'Parent Directory' not in file: + for xtag in tree.xpath('//table//tr/td[2]/a'): + name, file = xtag.text_content().strip(), xtag.attrib['href'] + if 'Parent Directory' not in name: dataFile = DirectoryTree() - dataFile.title = file + dataFile.title = name parent = self.__path.split("/") parentName = parent[len(parent) - 2] dataFile.key = self.__path + "/" + file.strip("/")