标签:htm port convert find main 代码 return from beautiful
目标 URL:http://tool.chinaz.com/tools/unicode.aspx
from bs4 import BeautifulSoup as bs
def find_data(res):
soup = bs(res.text, "html.parser")
target = soup.find("textarea", id="result")
return target.text
def convert(content):
data = {}
data["content"] = content
data["untoch"] = "Unicode 转 中文"
res = post("http://tool.chinaz.com/tools/unicode.aspx", data=data)
target = find_data(res)
return target
if __name__ == "__main__":
while True:
content = input("请输入 Unicode 代码:")
target = convert(content)
print(f"\n{target}\n")```
标签:htm port convert find main 代码 return from beautiful
原文地址:https://www.cnblogs.com/whx2008/p/12628493.html