我有一个复杂的对象声明性配置数组,我需要从中获取一些数据。
这是我的数组:
units = [{
'hpid': '787',
'hpr': 'Hotel Apartamento Solverde',
'pt': {
'CONVERSION': [],
'HOME_PAGE': [],
'PRODUCT': [],
'SEARCH': [],
'SHOPPING_CART': [],
'TRACKING': []
}
}, {
'hpid': '130',
'hpr': 'Hotel Algarve Casino',
'pt': {
'CONVERSION': [],
'HOME_PAGE': ['/hotel-algarve-casino/'],
'PRODUCT': [
'/hotel-algarve-casino/quartos/quarto-standard-vista-avenida/',
'/hotel-algarve-casino/quartos/quarto-superior-vista-mar/',
'/hotel-algarve-casino/quartos/quarto-familiar-vista-mar/',
'/hotel-algarve-casino/quartos/suite-vista-avenida/',
'/hotel-algarve-casino/quartos/suite-vista-mar/',
],
'SEARCH': [
'/hotel-algarve-casino/quartos/',
'/en/hotel-algarve-casino/rooms/'
],
'SHOPPING_CART': [],
'TRACKING': []
}
}, {
'hpid': '300',
'hpr': 'Hotel Casino Chaves',
'pt': {
'CONVERSION': [],
'HOME_PAGE': ['/hotel-casino-chaves/'],
'PRODUCT': [
'/hotel-casino-chaves/quartos/quarto-standard-vista-avenida/',
'/hotel-casino-chaves/quartos/quarto-superior-vista-mar/',
'/hotel-casino-chaves/quartos/quarto-familiar-vista-mar/',
'/hotel-casino-chaves/quartos/suite-vista-avenida/',
'/hotel-casino-chaves/quartos/suite-vista-mar/',
],
'SEARCH': [
'/hotel-casino-chaves/quartos/',
'/en/hotel-casino-chaves/rooms/'
],
'SHOPPING_CART': [],
'TRACKING': []
}
}, {
'hpid': '759',
'hpr': 'Hotel Solverde Spa and Wellness Center',
'pt': {
'CONVERSION': [],
'HOME_PAGE': [],
'PRODUCT': [],
'SEARCH': [],
'SHOPPING_CART': [],
'TRACKING': []
}
}
];
并且需要找到包含字符串ex:
/en/hotel-casino-chaves/rooms/
此外,我还需要上一次搜索的“hpid”属性的值。
我感谢你的帮助。
谢谢
那么我需要找到