gpt4 book ai didi

c# - 如何在C#中的文本框中获取维基百科内容

转载 作者:太空宇宙 更新时间:2023-11-03 13:20:55 24 4
gpt4 key购买 nike

<分区>

我想下载 wikipedia api 页面的内容并通过替换页面中的字符将其显示到文本框。

示例:链接到页面

http://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&explaintext=1&titles=stack%20overflow

我想要所有不需要的东西,比如

{"query":{"normalized":[{"from":"stack overflow","to":"Stack overflow"}],"pages":{"1436888":{"pageid":1436888,"ns":0,"title":"Stack overflow","extract":

应该被替换。

我试过了,但它不适用于此页面

textbox1.Text = XDocument.Parse(new Regex("[[(.*?]]").Matches(new WebClient().DownloadString("http://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts&explaintext=1&titles=stack%20overflow")[0].Value).Root.Value;

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com