Python函数【009】——读取网页到文本
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""
Date: 2019/11/28
Author: Xiao-Le Deng
Function: write a list into the file
"""
import urllib.request
def read_html(url):
html_text = str(urllib.request.urlopen(url).read().decode("utf-8"))
return html_text
# read_html("")