python中怎么输出字典中字典的值
#T 要求输出'./a/text()url_gglb_xpath_dic = { '中国邮政储蓄银行': {
'发行公告': [
'https://www.psbc.com/cn/grfw/tzlc/lc/ywgg/lcxsgg/index_页码.html',
'https://www.psbc.com/cn/grfw/tzlc/lc/ywgg/lcxsgg', # 拼接头
'//div[@class="col_list"]/ul/li', # li_xapth
'./a/text()', # xxbt_xpath
'./a/@href', # lianjie_xpath
'./span/text()', # xxfrq_xpath
],
'到期公告': [
'https://www.psbc.com/cn/grfw/tzlc/lc/ywgg/dqgg/index_页码.html',
'https://www.psbc.com/cn/grfw/tzlc/lc/ywgg/dqgg', # 拼接头
'//div[@class="col_list"]/ul/li', # li_xapth
'./a/text()', # xxbt_xpath
'./a/@href', # lianjie_xpath
'./span/text()', # xxfrq_xpath
],
'净值公告': [
'https://www.psbc.com/cn/grfw/tzlc/lc/ywgg/jzgg/index_页码.html',
'https://www.psbc.com/cn/grfw/tzlc/lc/ywgg/jzgg', # 拼接头
'//div[@class="col_list"]/ul/li', # li_xapth
'./a/text()', # xxbt_xpath
'./a/@href', # lianjie_xpath
'./span/text()', # xxfrq_xpath
],
},
}
代码:
a=url_gglb_xpath_dic['中国邮政储蓄银行']['到期公告']
for b in a:
if b == './a/text()':
print(b)
出的结果如下:
./a/text()
Process finished with exit code 0