360搜索主页爬虫

# 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)

  360搜索主页爬虫

上一篇:AMNESIA:33 多个TCP/IP开源代码库漏洞通告


下一篇:Compressor for Mac(视频转码编辑工具)中文激活版对系统的要求