diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-01-11 21:27:33 +0000 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-01-11 21:27:33 +0000 |
commit | 3ea0b526a831f66289548ff73aa27332c6954dd6 (patch) | |
tree | 62de98a472a6bc1ad253f77eb53bdf70c8034df1 | |
parent | 36e42b5cd75baae9a7a24ed4b370689fc4d4a83c (diff) | |
download | rel-html-3ea0b526a831f66289548ff73aa27332c6954dd6.tar.gz |
rel-html: use urlib2
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
-rwxr-xr-x | rel-html.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rel-html.py b/rel-html.py index d81c2cd..735bddb 100755 --- a/rel-html.py +++ b/rel-html.py @@ -19,7 +19,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. from HTMLParser import HTMLParser -import urllib +import urllib2 import ConfigParser import re, sys import os, getopt @@ -567,7 +567,7 @@ def check_file(file_input): usage() def __get_next_rel_page(url): - r = urllib.urlopen(url) + r = urllib2.urlopen(url) html = r.read() num_parser = largest_num_href_parser() return num_parser.parse(html) @@ -581,7 +581,7 @@ def get_next_rel_url(parser, url): def get_next_rel_html(parser, url): url = get_next_rel_url(parser, url) - r = urllib.urlopen(url) + r = urllib2.urlopen(url) return r.read() def read_rel_html(ver, url): @@ -599,7 +599,7 @@ def read_rel_html(ver, url): url_rel = url + 'v' + version - f_rel = urllib.urlopen(url_rel) + f_rel = urllib2.urlopen(url_rel) return f_rel.read() def main(): @@ -632,7 +632,7 @@ def main(): elif url.endswith('2013/'): html = html + get_next_rel_html(parser, url) else: - f = urllib.urlopen(url) + f = urllib2.urlopen(url) html = html + f.read() parser.parse(html) |