Question: I have a website I need to isolate XPATH identifiers on - they have an XPath ID like this `//*[@id="panel-detail-6163748c7952a-partnerCode"]`

The issue is that the website changes the value `6163748c7952a` on every page load.

Is there any such XPath expression which can match on the first/last part of that string? So of a wildcard like `//*[@id="panel-detail-*-partnerCode"]`

Answer: 
You can use zip to pair up the dictionaries withe the content strings and set the 'content' key for each:

```
dicList = [{'url': 'https://test.com/find/city-1', 'tit': 'title1', 'val': 1},
 {'url': 'https://test.com/find/city-2', 'tit': 'title1', 'val': 2},
 {'url': 'https://test.com/find/city-3', 'tit': 'title1', 'val': 3}
]
contents = ['a','b','c']
for d,c in zip(dicList,contents):
    d['content'] = c

print(dicList)

[{'url': 'https://test.com/find/city-1', 'tit': 'title1', 'val': 1, 'content': 'a'}, 
 {'url': 'https://test.com/find/city-2', 'tit': 'title1', 'val': 2, 'content': 'b'}, 
 {'url': 'https://test.com/find/city-3', 'tit': 'title1', 'val': 3, 'content': 'c'}]

```

Or, if you want the result in a new list, you can use a list comprehension to build augmented dictionaries:

```
dicList2 = [{**d, 'content':c} for d,c in zip(dicList,contents)]

```
Zip and assign:

```
for d, d['content'] in zip(dicts, contents):
    pass

```

Demo ([Try it online!](https://tio.run/##jZDBCoNADETv@YrcUmFbUS9F6JcUD3ZVXNDdsJsWbPHbrVZ7FQMhEGYezPAgrbPZlf00mZ6dF2T2xgpAZbQEvOH9Q0/fUY7UinDI41jqIBft@rgxtoq1keGckEISI4tsPl39e7zKxZeMCvAIJN2BpEch2Q4kG6EA7azUdo1GJSl6zKupAGicx0phdadNQwUai2/Dp18ZCv/eKAech8sQANbCLrypomn6Ag "Python 3.8 (pre-release) – Try It Online")):

```
import pprint

dicts = [{'url': 'https://test.com/find/city-1', 'tit': 'title1', 'val': 1},
 {'url': 'https://test.com/find/city-2', 'tit': 'title1', 'val': 2},
 {'url': 'https://test.com/find/city-3', 'tit': 'title1', 'val': 3}
]
contents = ['a','b','c']

for d, d['content'] in zip(dicts, contents):
    pass

pprint.pp(dicts)

```

Output:

```
[{'url': 'https://test.com/find/city-1',
  'tit': 'title1',
  'val': 1,
  'content': 'a'},
 {'url': 'https://test.com/find/city-2',
  'tit': 'title1',
  'val': 2,
  'content': 'b'},
 {'url': 'https://test.com/find/city-3',
  'tit': 'title1',
  'val': 3,
  'content': 'c'}]

```