代码拉取完成,页面将自动刷新
# -*- coding: UTF-8 -*-
import requests
import bs4
import json
import Handle
resources_file_path = '/airportNameList.txt'
scratch_url = 'https://data.variflight.com/profiles/profilesapi/search'
def scratch_airport_name(scratch_url, old_airports):
new_airports = []
data = requests.get(scratch_url).text
all_airport_json = json.loads(data)['data']['list']
for airport_by_word in all_airport_json.values():
for airport in airport_by_word:
if airport['profiles_city'] and airport['profiles_name'] not in old_airports:
new_airports.append(airport['profiles_city'] + ',' + airport['profiles_name'])
return new_airports
if __name__ == '__main__':
Handle.handle(resources_file_path, scratch_url, scratch_airport_name)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。