Wikipedia API-如何在“摘录”中获取图像标题或图像链接

给出以下查询

https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extracts|pageimages&redirects=1&pithumbsize=400&titles=Ruhleben_(Berlin_U-Bahn)

所有内容均按预期进行了解析,除了我要查询的标题的wiki page上有一个表示“ U2”行

Wikipedia API-如何在“摘录”中获取图像标题或图像链接

的嵌入式图像。我希望Wikipedia api至少返回图像标题“ U2(berlin U-Bahn)”,但它只会返回空白。与U7的图片相同。

有什么想法如何获得the western terminus of the U2 (berlin U-Bahn) line.甚至是带有图像链接的实际html文本?我可以传递一个参数吗?我不想获得整个html页面,但是我希望,如果摘录中没有包含重要的图像,则将其替换为标题,否则该句子就没有意义了。

pages:
  3007166:
    extracts:
      "<p><b>Ruhleben</b> is a berlin U-Bahn station,the western terminus of the  line. ...
limei2009 回答:Wikipedia API-如何在“摘录”中获取图像标题或图像链接

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2524492.html

大家都在问