diff --git a/pandas/io/html.py b/pandas/io/html.py index 8fd876e85889f..3b43a136c5424 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -127,8 +127,8 @@ def _read(obj): raw_text : str """ if _is_url(obj): - with urlopen(obj) as url: - text = url.read() + import requests + text = requests.get(obj).content elif hasattr(obj, 'read'): text = obj.read() elif isinstance(obj, char_types): @@ -985,3 +985,4 @@ def read_html(io, match='.+', flavor=None, header=None, index_col=None, decimal=decimal, converters=converters, na_values=na_values, keep_default_na=keep_default_na, displayed_only=displayed_only) +