【发布时间】:2018-05-15 14:38:30
【问题描述】:
我想从我的 Flutter 应用程序中的这个 JSON 中获取 16 作为数字:
link to the Json code
【问题讨论】:
-
您可以使用pub.dartlang.org/packages/html 来使用
querySelector()和类似的方式来获取HTML 文档的文件
我想从我的 Flutter 应用程序中的这个 JSON 中获取 16 作为数字:
link to the Json code
【问题讨论】:
querySelector() 和类似的方式来获取HTML 文档的文件
您需要导入 async、http 和 convert。
var response = await http.get("http://motyar.info/webscrapemaster/api/?url=http://teertoday.com/&xpath=/html/body/div[5]/div/table/tbody/tr[3]/td[1]#vws");
var jsonResponse = json.decode(response);
var line = jsonResponse["text"].replaceAll(new RegExp(r"(\s\n)"), ""); //this gives you the line of "text" and then replaces all of the spaces and \n
【讨论】:
我不熟悉颤振,但我会读取键“文本”的值,然后用正则表达式过滤它的数字。
【讨论】: