【问题标题】:Getting data from html code从 html 代码中获取数据
【发布时间】:2014-10-30 13:57:40
【问题描述】:

我有一个只显示温度的网站。现在我希望 Xcode 加载页面并获取温度。 这是网站代码:

<!DOCTYPE HTML>
<html>
tempfan1:43.57
</html>

在 Xcode 中,我使用 WebView 加载了网站。 WebView 现在显示网站,但我想获取网站的源代码并将“tempfan1”的值存储到浮点数中,但我不知道如何获取网站的源代码。

【问题讨论】:

标签: html objective-c xcode macos


【解决方案1】:

您投了反对票,因为您没有表现出任何研究努力。我不知道 XCode 或 Objective-C,但快速搜索会在 20 秒内找到答案。

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSData_Class/index.html#//apple_ref/occ/clm/NSData/dataWithContentsOfURL:

UIWebView get HTML Source

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多