- 使用cheerio获取股票价格(东方财富网或者同花顺等网站)?
使用cheerio获取东方财富网站个股价格,总是显示“-”,获取其他内容是可以的。 有没有办法解决? 补充: 一、计划 获取网址http://quote.eastmoney.com/sh600519.html 中的,股票价格(1820.00), [图片] [图片] 二、云函数 cheerio.js const got = require('got') const cheerio = require('cheerio'); exports.main = async (event, context) => { var res = await got(event.wz) .then(response => { html = response.body const $ = cheerio.load(html) title = $('#price9').text() return title }) .catch(error => { return "READ ERR..." }); return res } 三、index.js onLoad: function (options) { let wz = 'http://quote.eastmoney.com/sh600519.html' wx.showLoading({ title: '连接中...', }) wx.cloud.callFunction({ name: 'Cherio', data: { wz: wz } }).then(res => { this.setData({ nr: res.result }) console.log(this.data.nr) wx.hideLoading() }).catch((e) => { wx.showToast({ title: e, duration: 3000, mask: true }) }) }si 四、结果:只显示一个“-” [图片] [图片]
2021-09-29 - 怎么获取返回promise中的数据?
onLoad: function () { let openid = this.getOpenid() console.log(openid ) } 返回数据如图,我怎么才能获取到 openID? 我是小白,希望能直接给个代码,谢谢。 [图片]
2021-09-25 - 提示“请先调用 wx.cloud.init() 完成初始化后再调用其他云 API。”咋办?
VM975 WAService.js:2 Error: errCode: -1 | errMsg: Cloud API isn't enabled, please call wx.cloud.init first 请先调用 wx.cloud.init() 完成初始化后再调用其他云 API。 咋办呀?那个高手给指点一下。 [图片]
2021-09-04 - 使用ColorUi,提示“Cannot set property 'StatusBar' of?
使用ColorUi,提示“Cannot set property 'StatusBar' of undefined”,我是小白,希望高手能给指导一下!谢谢! 这个是在APP.JS中的。 [图片] [图片]
2021-09-04