基本信息
源码名称:联合国贸易世界数据库爬虫
源码大小:3.61KB
文件格式:.py
开发语言:Python
更新时间:2021-08-27
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

联合国贸易世界数据库爬虫


for year in range(start_time,end_time 1):
    hs_Path = root r'\\'  str(year) if not os.path.exists(root):
        os.mkdir(root) # 判断HS文件是否建立,没有则建立,有则继续执行  if not os.path.exists(hs_Path):
        os.mkdir(hs_Path) # 判断编码文件是否建立,没有则建立,有则继续执行   for country in countrylink: # 创建历年的csv文件路径  csv_path = hs_Path r'/'  str(country) r'.csv'  # 判断csv文件是否存在  if os.path.exists(csv_path): continue   else:
            OrignLink = olink str(year) '&r='  str(
                country) "&p=all&rg=1%2C2&cc="  product_code r"&uitoken=3a3ced135ca174360700faa4fb6bf85a&fmt=csv" # 为链接增加年份   # 调用函数s  # try:  download_source(OrignLink, csv_path) print(country, '国家爬取完毕!')
            time.sleep(3) # except Exception as e:  #     main()   print(year, '产品爬取完毕')
    time.sleep(3)