Skip to content
This repository has been archived by the owner on Sep 9, 2021. It is now read-only.

Commit

Permalink
Fix wellsfargo on Debian Wheezy
Browse files Browse the repository at this point in the history
  • Loading branch information
tubaman committed Aug 25, 2013
1 parent 4b4bc3e commit d9a3e5d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
24 changes: 22 additions & 2 deletions bankscrape/banks/wellsfargo.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
#!/usr/bin/env python
import logging
import ssl
import os, sys, re, StringIO, csv

from bs4 import BeautifulSoup
import requests
from bs4 import BeautifulSoup
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.poolmanager import PoolManager
from bankscrape.scraper import unescape_html

logger = logging.getLogger(__name__)
logger.setLevel(logging.WARN)

SCRAPER = requests.session()
class TLSv1Adapter(HTTPAdapter):
"""Force TLSv1
Wells Fargo hangs with requests' default SSL setup so hard-set
TLSv1 here.
http://lukasa.co.uk/2013/01/Choosing_SSL_Version_In_Requests/
"""

def init_poolmanager(self, connections, maxsize, **kwargs):
self.poolmanager = PoolManager(num_pools=connections,
maxsize=maxsize,
ssl_version=ssl.PROTOCOL_TLSv1)


SCRAPER = requests.Session()
SCRAPER.mount('https://', TLSv1Adapter())

def login(username, password):
SCRAPER.get('https://www.wellsfargo.com/')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
beautifulsoup4==4.1.3
distribute==0.6.24
requests==0.14.2
requests==1.2.3

0 comments on commit d9a3e5d

Please sign in to comment.