1
0
mirror of https://github.com/bspeice/metrik synced 2025-08-03 06:04:47 -04:00

Requests doesn't support 3.2, neither shall we

This commit is contained in:
Bradlee Speice
2016-08-08 23:31:49 -04:00
parent 52eaa4b663
commit 6c91c1cb1f
4 changed files with 3 additions and 5 deletions

View File

@ -1,4 +1,3 @@
import requests
from luigi import Task, Parameter
from pyquery import PyQuery as pq
import logging
@ -44,7 +43,7 @@ class BloombergEquityInfo(Task):
url = 'http://www.bloomberg.com/quote/{}'.format(
quote_plus(bbg_code))
logging.info('Visiting "{}" with agent "{}'.format(url, user_agent))
html = requests.get(url, headers={'User-Agent': user_agent}).text
html = pq(url, {'User-Agent': user_agent}).html()
keys = ['Sector', 'Industry', 'Sub-Industry']
eq_info = EquityInfoParser(keys)