Вот самая простая программа с использованием urllib:
import urllib.request
site = urllib.request.urlopen("http://ex.ua")
page = site.read()
print(page)
Но вместо кода странички вижу кучу ошибок:
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "/usr/lib/python3.2/hashlib.py", line 141, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "/usr/lib/python3.2/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type %s' % name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
File "/home/guest/workspace/test/main.py", line 1, in <module>
import urllib.request
File "/usr/lib/python3.2/urllib/request.py", line 88, in <module>
import http.client
File "/usr/lib/python3.2/http/client.py", line 69, in <module>
import email.parser
File "/usr/lib/python3.2/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser
File "/usr/lib/python3.2/email/feedparser.py", line 27, in <module>
from email import message
File "/usr/lib/python3.2/email/message.py", line 17, in <module>
from email import utils
File "/usr/lib/python3.2/email/utils.py", line 27, in <module>
import random
File "/usr/lib/python3.2/random.py", line 45, in <module>
from hashlib import sha512 as _sha512
ImportError: cannot import name sha512
Думаю что что-то с питоном, вернее с библиотеками.