Commit df517069 authored by Sergio Bruni's avatar Sergio Bruni

commmit

parent 320dd064
......@@ -22,6 +22,7 @@ import requests
from . import utils
from datetime import datetime, timedelta
from base64 import b64encode
import ssl
......@@ -527,21 +528,24 @@ class HTTP_aragea(HTTP_GENERIC, object):
def list_remote_stations(self):
try:
#url = urllib.parse.urljoin(self.org, "/bases.php")
url = urllib.parse.urljoin(self.org, "/web/ges_menu_en.php")
post_data = urllib.parse.urlencode({
'crtl_menu': 54
}).encode("utf-8")
ssl._create_default_https_context = ssl._create_unverified_context
request = urllib.request.Request(url, post_data)
#request = urllib.request.Request(url)
my_data = urllib.request.urlopen(request).read()
except urllib.error.HTTPError as e:
self.logger.error("[%s]: could not connect to [%s] urllib2.HTTPError code %s" % (self.__class__, url, e.code))
return None
return []
except Exception as e:
self.logger.error("[%s]: could not connect to [%s]" % (self.__class__, url))
self.logger.error("{0}".format(e))
return None
return []
soup = BeautifulSoup(my_data, "html.parser")
stations_select = soup.find("select", {"name":"bases"})
......@@ -559,7 +563,9 @@ class HTTP_aragea(HTTP_GENERIC, object):
filelist = []
for option in options:
filelist.append( option.attrs['value'])
return filelist
#return ['ACIN']
def get_file(self, dest_file_name, dest_dir_name, my_date, station):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment