我是 webharvest 的新手,正在使用它从网站获取文章数据,使用以下语句:
let $text := data($doc//div[@id="articleBody"])
这是我从上述声明中得到的数据:
The Refine Spa (Furman's Mill) was built as a stone grist mill along the on a tributary of Capoolong Creek by Moore Furman, quartermaster general of George Washington's army
Notable people
Notable current and former residents of Pittstown include:
我的问题是,是否可以在上面的示例中从另一个字符串中减去一个字符串:内容中的“知名人士”。
有可能这样做吗?如果可能,请让我知道如何。谢谢。有什么我可以这样做的:
if (*contains*($text, 'Notable people')) then $text := *minus*($text, 'Notable people')
contains是一个示例函数名称,用于确定一个字符串是另一个的子字符串,减号是一个示例函数名称,用于从另一个中删除子字符串
所需的输出:
The Refine Spa (Furman's Mill) was built as a stone grist mill along the on a tributary of Capoolong Creek by Moore Furman, quartermaster general of George Washington's army
Notable current and former residents of Pittstown include: