我输入了一个简单的代码来测试bs4,如下所示。
# -*- coding: utf-8 -*-
import bs4
import requests
page_url = 'http://www.naver.com'
response = requests.get(page_url)
soup = bs4.BeautifulSoup(response.text)
print(type(soup))
print (soup.prettify()[0:1000])
如果您检查添加图像文件,则可以在输出窗口中看到损坏的韩文字母。我怎么解决这个问题?谢谢。
我不知道这对你有帮助。这是一个task.json文件。
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "python",
"isShellCommand": true,
"args": ["${file}"],
"showOutput": "always",
}
感谢您的回答,OrangeFlash81
{
// Controls after how many characters the editor will wrap to the next line. Setting this to 0 turns on viewport width wrapping (word wrapping). Setting this to -1 forces the editor to never wrap.
"editor.wrappingColumn": 0, // default value is 300
// Controls the font family.
"editor.fontFamily": "Consolas, 'Malgun Gothic', '맑은 고딕','Courier New', monospace",
// Controls the font size.
"editor.fontSize": 15,
}