Update jst_ph_search.py
parent
6ab520b8b0
commit
fc0d17cbe9
|
@ -10,7 +10,7 @@ def write_to_file(searchfilename, json_data):
|
|||
s_id_wr = DictWriter(s_id, fieldnames=column)
|
||||
if s_id.tell() == 0:
|
||||
s_id_wr.writeheader()
|
||||
print(json_data)
|
||||
# print(json_data)
|
||||
# input()
|
||||
writeable_data = {
|
||||
"jobid" : json_data.get('id'),
|
||||
|
@ -47,6 +47,7 @@ def ph_search(searchfilename):
|
|||
}
|
||||
|
||||
while current_page<= total_pages :
|
||||
print(f'{current_page} of {total_pages})
|
||||
query_params = {
|
||||
"siteKey": "PH-Main",
|
||||
"sourcesystem": "houston",
|
||||
|
@ -68,6 +69,7 @@ def ph_search(searchfilename):
|
|||
total_pages = ceil(response.json()['totalCount']/100)
|
||||
for each_job in response.json()['data']:
|
||||
write_to_file( searchfilename, each_job)
|
||||
current_page +=1
|
||||
else:
|
||||
print("Request failed with status code:", response.status_code)
|
||||
|
||||
|
|
Loading…
Reference in New Issue