Найти - Пользователи
Полная версия: Вопрос по Python 3 для Windows 7
Начало » Python для новичков » Вопрос по Python 3 для Windows 7
1
Bokal1
 import urllib
from lxml.html import fromstring
url = 'https://www.facebook.com/'
html = urllib.urlopen(url).read();

Результат:
AttributeError: module ‘urllib’ has no attribute ‘urlopen’

В чём проблема ?
py.user.next
  
>>> import urllib.request
>>> urllib.request.urlopen
<function urlopen at 0xb73ce614>
>>>
Читай документацию к третьему питону.
https://docs.python.org/3/
https://docs.python.org/3/library/urllib.request.html
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB