我们可以用Python来将一个网页保存为本地的HTML文件,这需要用到urllib库。 比如我们要下载山东大学新闻网的一个页面,该网页如下: 实现代码如下: import urllib.request def getHtml(url): html = urllib.request.urlopen(url).read() return html def saveHtml(file_name, file_content): # 注意windows文件命名的禁用符,比如 / with open(file_name.replace('/', '_') + ".html", "wb") as
2022-06-15 23:10:11 198KB html代码 html文件 python
1
使用S7-1500的Web服务器通过本地的HTML读写PLC中的数据_示例