ssergej

WTF

Apr 29th, 2013
56
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import urllib.request
  2. import lxml.html
  3.  
  4. page = urllib.request.urlopen("http://google.ru/")
  5.  
  6. doc = lxml.html.document_fromstring(page.read())
  7.  
  8. print(doc)
  9. print(doc.__dict__)
  10. for topic in doc.cssselect('#gs_htif0'):
  11.     print(topic)
  12.  
  13. """
  14. Вот что получается:
  15. <Element html at 0x7f4c7a1af350>
  16. {}
  17. """
RAW Paste Data