add user-agent list

This commit is contained in:
2022-03-21 17:13:11 +01:00
parent 68680af13b
commit a5b172d4d6
3 changed files with 113 additions and 72 deletions
+14 -2
View File
@@ -2,6 +2,7 @@ import json
import pandas as pandas
import definitions
from pojo.contact_pojo import ContactPojo
@@ -24,7 +25,17 @@ class ExcelHelper:
self.write_to_exel("ccid_list.xlsx", ccids.split(","))
print(lines)
# read the contact list from the exel file
def read_user_agent_list(self):
# read the contact list from the exel file
contact_list_in_json = pandas.read_excel(definitions.ROOT_DIR + "/docs/mobile_user_agent_list.xlsx").to_json(
orient='records')
contact_dict_list = json.loads(contact_list_in_json)
user_agents = []
for contact_dict in contact_dict_list:
user_agent = contact_dict['user_agent']
user_agents.append(user_agent)
return user_agents
def read_contacts(self) -> list:
contact_list_in_json = pandas.read_excel(r'./contact.xlsx').to_json(orient='records')
contact_dict_list = json.loads(contact_list_in_json)
@@ -46,4 +57,5 @@ class ExcelHelper:
if __name__ == '__main__':
helper = ExcelHelper()
helper.generate_exel_from_txt()
# helper.generate_exel_from_txt()
print(helper.read_user_agent_list())