企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
~~~ urlopen爬取百度首页HTML ~~~ ```` #百度首页爬取 from urllib.request import urlopen #从请求库中导入urlopen url = "http://www.baidu.com" resp = urlopen(url) with open("baidu.html", mode\="w") as f: f.write(resp.read().decode('utf-8')) #读取到的网页的数据 f.close() print('over')