标签:lazy img ima 搜索关键词 int inf word com htm
# encoding: utf-8 import urllib.request import urllib.parse url = "https://www.so.com/s?q=" keyword = input("请输入搜索关键词") keyword = urllib.parse.quote(keyword) urlkeyword = url+keyword print(urlkeyword) response = urllib.request.urlopen(url=urlkeyword) content = response.read() print(content) html = content.decode(‘UTF-8‘) print(html) with open("360shanxijiaotong.html", "w", encoding="utf-8") as f: f.write(html)
标签:lazy img ima 搜索关键词 int inf word com htm
原文地址:https://www.cnblogs.com/hhct/p/14134899.html