我正在考虑使用Beautiful Soup,一个用于HTML抓取的Python包.我应该看看还有其他HTML抓包吗?Python不是必需的,我实际上也有兴趣了解其他语言.
到目前为止的故事:
如何返回这样的多个错误消息?
"errors": [
{
"message": "first error",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"somePath"
]
},
{
"message": "second error",
"locations": [
{
"line": 8,
"column": 9
}
],
"path": [
"somePath"
]
},
]
Run Code Online (Sandbox Code Playgroud)
在我的服务器上,如果我这样做throw('an error')
,它会返回.
"errors": [
{
"message": "an error",
"locations": [
{
}
],
"path": ["somePath"]
}
]
Run Code Online (Sandbox Code Playgroud)
我想返回查询中所有错误的数组.如何向errors
阵列添加多个错误?