各位大神好,最近我遇到一个难题,从网上爬下json数据后,不知道咋解析了,自己也搜索了解析方法并尝试了下,不过本人能力有限,并没有解析出来,有哪位大神知道怎么弄还望解惑,感谢感谢。
问题:想要从下面的json数据中的rows的cells中获取比如bond_id,bond_nm的数据
1.获取json数据的代码如下:
- Sub Main()
- Dim strText As String
- Dim objJSx As Object, objJSy As Object
- Dim arrData(1 To 100, 1 To 4)
- With CreateObject("MSXML2.XMLHTTP") 'CreateObject("WinHttp.WinHttpRequest.5.1")'
- .Open "GET", "https://www.jisilu.cn/data/cbnew/cb_list_new/?___jsl=LST___t=1637663500061", False
- .setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
- .setRequestHeader "Referer", "https://www.jisilu.cn/data/cbnew/"
- .Send
- strText = .responsetext
- Debug.Print strText
- End With
- Set objJSx = CreateObject("ScriptControl")
- objJSx.Language = "JScript"
- Set objJSy = objJSx.eval("eval(" & strText & ")")
- End Sub
复制代码 2.爬下来的部分json数据如下:
- <blockquote>{"page":1,"rows":[{"id":"127011","cell":{"bond_id":"127011","bond_nm":"中鼎转2","bond_py":"zdz2","price":173.4,"increase_rt":-5.81,"stock_id":"000887","stock_nm":"中鼎股份","stock_py":"zdgf","sprice":19.85,"sincrease_rt":-5.52,"pb":2.56,"convert_price":11.39,"convert_value":174.28,"convert_dt":0,"premium_rt":-0.5,"dblow":172.9,"adjust_condition":"15\/30 85%","sw_cd":"280201","market_cd":"szmb","btype":"C","list_dt":"2019-04-04","qflag2":"N","owned":0,"hold":0,"bond_value":"buy","rating_cd":"AA+","option_value":null,"put_convert_price":7.97,"force_redeem_price":14.81,"convert_amt_ratio":3.8,"fund_rt":"buy","short_maturity_dt":"25-03-08","year_left":3.11,"curr_iss_amt":9.192,"volume":42250.67,"svolume":66272.34,"turnover_rt":25.79,"ytm_rt":-12.73,"put_ytm_rt":null,"notes":null,"noted":0,"bond_nm_tip":"最后交易日:2022年2月23日\r\n最后转股日:2022年2月23日\r\n赎回价:100.97元\/张","redeem_icon":"R","last_time":"15:14:03","qstatus":"00","margin_flg":"R","sqflag":"Y","pb_flag":"N","adj_cnt":0,"adj_scnt":0,"conve
复制代码
|