passage pyramid 1.10

This commit is contained in:
2018-12-22 10:33:44 +01:00
parent 0b6cbcebd5
commit 7ef84bada2
4 changed files with 11 additions and 12 deletions

View File

@@ -11,7 +11,7 @@ from zope.sqlalchemy import ZopeTransactionExtension, mark_changed
from datetime import *
import transaction
from bs4 import BeautifulSoup
import urllib2
from urllib.request import urlopen
from .default import (
execute_query,
@@ -146,7 +146,7 @@ def getCurrencyRate(currency):
quote_page = 'https://markets.ft.com/data/currencies/tearsheet/summary?s=%seur' % currency
# query & parse the html using beautiful soap and store in variable `soup`
soup = BeautifulSoup(urllib2.urlopen(quote_page), 'html.parser')
soup = BeautifulSoup(urlopen(quote_page), 'html.parser')
data_list = soup.find_all("span", class_="mod-ui-data-list__value")
if data_list:
# get the rate price in EUR
@@ -161,7 +161,7 @@ def getFTQuote(ticker):
quote_page = 'https://markets.ft.com/data/funds/tearsheet/historical?s=%s' % ticker
# query & parse the html using beautiful soap and store in variable `soup`
soup = BeautifulSoup(urllib2.urlopen(quote_page), 'html.parser')
soup = BeautifulSoup(urlopen(quote_page), 'html.parser')
data_list = soup.find_all("span", class_="mod-ui-data-list__value")
if data_list:
# get the quote price