add user-agent list
This commit is contained in:
+14
-2
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user