Могу предложить сделать:
- Строка-шаблон для URL
- Работа только с значениями словаря
Пример:
areas = {
'Краснодарский край': '1_11',
'Ростовская обл': '1_12',
'Ставропольский край': '1_13',
'Московская обл': '1_1'
}
PATTERN_URL = 'https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"{value_from}","fromGeo":"{value_from}","to":"","toGeo_tmp":"{value_to}","toGeo":"{value_to}","rate":15%7D'
geos = areas.values()
for value_from in geos:
for value_to in geos:
url = PATTERN_URL.format(value_from=value_from, value_to=value_to)
print(url)
Можно, конечно, сделать кое-что, что я бы не рекомендовал. Используя product получите тот же результат как если бы использовался двойной цикл:
from itertools import product
...
for value_from, value_to in product(geos, repeat=2):
url = PATTERN_URL.format(value_from=value_from, value_to=value_to)
print(url)
Результат:
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_11","fromGeo":"1_11","to":"","toGeo_tmp":"1_11","toGeo":"1_11","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_11","fromGeo":"1_11","to":"","toGeo_tmp":"1_12","toGeo":"1_12","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_11","fromGeo":"1_11","to":"","toGeo_tmp":"1_13","toGeo":"1_13","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_11","fromGeo":"1_11","to":"","toGeo_tmp":"1_1","toGeo":"1_1","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_12","fromGeo":"1_12","to":"","toGeo_tmp":"1_11","toGeo":"1_11","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_12","fromGeo":"1_12","to":"","toGeo_tmp":"1_12","toGeo":"1_12","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_12","fromGeo":"1_12","to":"","toGeo_tmp":"1_13","toGeo":"1_13","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_12","fromGeo":"1_12","to":"","toGeo_tmp":"1_1","toGeo":"1_1","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_13","fromGeo":"1_13","to":"","toGeo_tmp":"1_11","toGeo":"1_11","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_13","fromGeo":"1_13","to":"","toGeo_tmp":"1_12","toGeo":"1_12","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_13","fromGeo":"1_13","to":"","toGeo_tmp":"1_13","toGeo":"1_13","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_13","fromGeo":"1_13","to":"","toGeo_tmp":"1_1","toGeo":"1_1","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_1","fromGeo":"1_1","to":"","toGeo_tmp":"1_11","toGeo":"1_11","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_1","fromGeo":"1_1","to":"","toGeo_tmp":"1_12","toGeo":"1_12","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_1","fromGeo":"1_1","to":"","toGeo_tmp":"1_13","toGeo":"1_13","rate":15%7D
https://loads.ati.su/#?filter=%7B"exactFromGeos":true,"exactToGeos":true,"extraParams":129,"from":"","fromGeo_tmp":"1_1","fromGeo":"1_1","to":"","toGeo_tmp":"1_1","toGeo":"1_1","rate":15%7D