05 2021 档案
摘要:定义div <div id="showdata"> </div> jq读取 var url="python/datajson.json"; var request = new XMLHttpRequest(); request.open("get",url); request.send(null);
阅读全文
摘要:ssa2 = location.read_locationa(row[4]) datajson["weather"]=ssa2['weather'] datajson["temperature"]=ssa2['temperature'] datajson["windpower"]=ssa2['win
阅读全文
摘要:计算天气的合格率 def dangday(day): sum = 0 a = True haotianqi = {'晴','少云','晴间多云','有风','平静','微风','和风','清风'} zhong = {'多云','阴','霾','中度霾','阵雨','雷阵雨','小雨','毛毛雨/细雨
阅读全文
摘要:函数获取使用高德天气接口 import requests 爬取数据 def read_location(name): centerurl = "https://restapi.amap.com/v3/config/district?keywords=" centerurl2 = "&subdistr
阅读全文
摘要:查询其所在地区的省市区的名字 def read_location(name): centerurl = "https://restapi.amap.com/v3/config/district?keywords=" centerurl2 = "&subdistrict=2&key=ecbbca20a
阅读全文
摘要:昨日的读取最后运行后发现无法读取,因为高德把交通态势的服务接口,但是高德交通态势页面又可以查看地区的交通实时情况,所以直接页面操作查询数据读取 操作页面需要包 from selenium import webdriver import time import location 进入页面两种区别 ro
阅读全文
摘要:依旧是先读取地区代码,然后圆形搜索地区的交通态势 arr = sheet.du_sql() 链接设置 url1="https://restapi.amap.com/v3/traffic/status/circle?key=ecbbca20adc1bcb1e1416c23a8929921&locati
阅读全文
摘要:读取json文件的数据 with open('./jingqu/datapoi.json', 'r') as file: data = file.read() data = json.loads(data) 链接数据库 def du_sql(): mydb = mysql.connector.con
阅读全文
摘要:arr = sheet.read_excel() 读取表格的地址代码 url1="https://restapi.amap.com/v3/place/text?key=807c3aaf8b58a288aa83b28d11c817e4&keywords=景区&types=风景名胜&city=" url
阅读全文
摘要:此次爬取需要引用包有 import sheet import time import json import requests 此处做的为函数,需要mian函数来调用,为了方便程序运行统一成功。 def read_poi(): #各下级行政区的代码,若是嫌逐个复制麻烦可以通过读取文件的方式实现,此处
阅读全文