fix webpage
This commit is contained in:
@@ -58,14 +58,26 @@ class WPExport:
|
||||
# Download HTML
|
||||
|
||||
def downloadHTML(self, first, second):
|
||||
self._downloadPage(webpage[first][second], self._dir)
|
||||
try:
|
||||
with open("{0}/{1}.json".format(self._tmp, self._name)) as file:
|
||||
webpage = json.loads(file.read())
|
||||
self._downloadPage(webpage[first][second], self._dir)
|
||||
except Exception as ex:
|
||||
self._logger.error("{0} : Read file json from tmp : {1}".format(self._name, ex))
|
||||
|
||||
# Download Image
|
||||
|
||||
def downloadImg(self, first, second):
|
||||
page_src = self._getImg(webpage[first][second])
|
||||
o = urlparse(self._url)
|
||||
self._downloadPage(page_src, "{0}/{1}/{2}".format(self._dir, o.path, "img"))
|
||||
try:
|
||||
with open("{0}/{1}.json".format(self._tmp, self._name)) as file:
|
||||
webpage = json.loads(file.read())
|
||||
page_src = self._getImg(webpage[first][second])
|
||||
o = urlparse(self._url)
|
||||
self._downloadPage(page_src, "{0}/{1}/{2}".format(self._dir, o.path, "img"))
|
||||
except Exception as ex:
|
||||
self._logger.error("{0} : Read file json from tmp : {1}".format(self._name, ex))
|
||||
|
||||
|
||||
|
||||
|
||||
# Get URL
|
||||
|
Reference in New Issue
Block a user