Пытаюсь выполнить следующий код
import urllib.request
BROWSER_SETTING = [('User-agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1'),
('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'),
('Accept-Language', 'ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3'),
('Accept-Encoding', 'gzip, deflate'),
('Accept-Charset', 'windows-1251,utf-8;q=0.7,*;q=0.7'),
('DNT', '1'),
('Connection', 'keep-alive'),
('Cache-Control', 'max-age=0 ')]
opener = urllib.request.build_opener()
opener.addheaders(BROWSER_SETTING)
opener.open('http://yandex.ru').read()
Accept-Language: ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Dnt: 1
Connection: close
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7
Host: yandex.ru