ce='https://help.aaaa.com/static/index.html?source=app_ckck_home&daijia_token=g7gXMwq33SEUrR121zkWknlOUfhdlHaReDiHsWtPrLYczbsKAkEMheF3-euwJLOTWZPW3nfwsl6aERSrxXeXsTrwceDf6EoyTzopQjfShF5IU1UV-kza4lGaRS2t1GGVHOMk-wPCkQThRJYIbYtHKzXcm3Ahq5qwkhvv5-d1Xkn9ClfSvDYPXcos3Ejs31TbqSHchyA8xv8XAAD__w==&daijia_pid=561268899&appid=10000&lang=zh-CN&trip_cityid=1&datatype=101&imei=a1da7b060f33c8057b8936dacf7bc85c&channel=102&appversion=5.2.36&trip_country=CN&TripCountry=CN&lng=116.280718&maptype=soso&os=iOS&utc_offset=480&location_cityid=1&deviceid=a1da7b060f33c8057b8936dacf7bc85c&cityid=1&location_country=CN&phone=7N1+TAx95SYSyJvr7hzYnw==&model=iPhoneXS&lat=40.047946&origin_id=1&terminal_id=1&sig=d9911875f7c9509b89119a674d67b28e14cdca84'
inProgress='https://help.aaaa.com/static/index.html?appid=10000&lang=zh-CN&trip_cityid=1&datatype=101&imei=a1da7b060f33c8057b8936dacf7bc85c&channel=102&appversion=5.2.36&trip_country=CN&TripCountry=CN&lng=116.280894&maptype=soso&os=iOS&utc_offset=480&location_cityid=1&deviceid=a1da7b060f33c8057b8936dacf7bc85c&cityid=1&location_country=CN&phone=7N1+TAx95SYSyJvr7hzYnw==&model=iPhoneXS&lat=40.048013&origin_id=1&terminal_id=1&sig=e29ee1042b120b91586421c54f3e2e4522dfa120'
想要对比一下两个请求参数,哪个多哪个少,由于参数太多,写一个小程序打印一下
def split_word(split_word):
split_result=(split_word.split('?')[1]).split('&')
result=[]
for i in split_result:
result.append(i.split('=')[0])
return result
ce_result=split_word (ce)
#print(ce_result)
inProgress=split_word (inProgress)
print('侧边栏url中有而行程中url中没有的:',set(ce_result).difference(set(inProgress)))
print('行程中url中有而侧边栏url中没有的:',set(inProgress).difference(set(ce_result)))
print('两个url中都有的参数:',set(inProgress).intersection(set(ce_result)))