gpt4 book ai didi

javascript - 如何获取跨域网页的html?

转载 作者:行者123 更新时间:2023-11-28 02:20:10 25 4
gpt4 key购买 nike

我正在开发一个网页,我需要获取另一个跨域网站的 html 内容。在 google 时我了解了 YQL。但我不熟悉YQl。我们可以使用 JavascriptJquery 解决这个问题吗?

您的建议将会非常有帮助。

最佳答案

您可以使用WebClient服务器端的类来读取其他页面。

WebClient client = new WebClient();
string result = client.DownloadString(address);

下载整个页面输出。

关于javascript - 如何获取跨域网页的html?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15767215/

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