标签:one enc lis 打开 bsp src pen app agent
1 import json 2 ‘‘‘ 3 打开网页,直接保存网页proxy_list.txt ,然后用工具将其处理为 json 文件! 4 ‘‘‘ 5 with open("proxy_list.json","r",encoding="utf8") as f: 6 data_lists = json.load(f) 7 8 final_data = [] 9 for data_dict in data_lists : 10 address_sets = set(data_dict["export_address"]) #变为 set 去重 11 port = data_dict["port"] 12 type =data_dict["type"] 13 # print(address_sets) 14 for address in address_sets: 15 temp = {type :address + ":" + str(port)} 16 # print(temp) 17 final_data.append(temp) 18 with open("PROXY_LISTS.json","a+",encoding="utf8") as f: 19 json.dump(final_data,f) 20 print(len(final_data))
import json
‘‘‘
打开网页,直接保存网页proxy_list.txt ,然后用工具将其处理为 json 文件!
‘‘‘
with open("proxy_list.json","r",encoding="utf8") as f:
data_lists = json.load(f)
final_data = []
for data_dict in data_lists :
address_sets = set(data_dict["export_address"]) #变为 set 去重
port = data_dict["port"]
type =data_dict["type"]
# print(address_sets)
for address in address_sets:
temp = {type :address + ":" + str(port)}
# print(temp)
final_data.append(temp)
with open("PROXY_LISTS.json","a+",encoding="utf8") as f:
json.dump(final_data,f)
print(len(final_data))
自动 构建获取USER_AGENT 和 PROXY_LIST
标签:one enc lis 打开 bsp src pen app agent
原文地址:https://www.cnblogs.com/zach0812/p/12046742.html