python 爬取html页面
1 #coding=utf-8 2 import urllib.request 3 4 def gethtml(url): 5 page=urllib.request.urlopen(url) 6 html=page.read().decode("utf-8") 7 8 return html 9 10 11 12 url="........" 13 14 html = gethtml(url) 15 16 17 print(html)
有些网站的页面无法全部爬取(笔记)