IPGeo Search
v1.0.1: Updated redundancy
Ipgeo-Search เป็นโมดูล Python ที่ช่วยให้ใช้งาน IPGEO API ได้ง่าย ช่วยให้ทั้งผู้ใช้ฟรีและชำระเงินสามารถส่งคำขอไปยังเซิร์ฟเวอร์ในรหัสเพียงบรรทัดเดียวเพื่อให้สามารถปรับแต่งวิธีการโหลดรายการ IP ได้ เราเสนอการทดลองใช้ฟรี 5 วันสำหรับ API ของเราบนหน้าเว็บของเรา หากต้องการรับคีย์ API ทดลองใช้ฟรีติดต่อห้องปฏิบัติการของเราและเราจะส่งให้คุณ
ในการติดตั้ง ipgeOsearch ให้เรียกใช้
pip install IPGeoSearch ก่อนที่จะทำงานบนคอมพิวเตอร์ในพื้นที่ของคุณตรวจสอบให้แน่ใจว่าคุณได้ติดตั้ง python 3.6+ พร้อมกับ pandas เวอร์ชันล่าสุดที่ติดตั้ง
ในการติดตั้ง pandas ให้เรียกใช้:
pip install pandas ฟังก์ชั่น search ใช้ใน 3 อาร์กิวเมนต์:
ipList: an Array of IP's where each IP is a string.
path: Where the result files are downloaded to.
key: The API Key sent to you.
ในการใช้เวอร์ชันใดรุ่นหนึ่งคุณต้องส่งคีย์ของคุณไปยังเซิร์ฟเวอร์
from IPGeoSearch import search
with open ( 'ipList.txt' , 'r' ) as f :
ip = [ line . strip () for line in f ]
f . close ()
with open ( 'yourkey.key' , 'r' ) as hashkey :
key = hashkey . read (). replace ( ' n ' , '' )
hashkey . close ()
search . search ( ipList = ip , path = '' , key = key )ข้อผิดพลาดทั่วไปคือ:
TypeError : "An entry in ipList is not a string at line and cannot be read by the server"
RuntimeError : "Your Key is Invalid. Please purchase a key or start a trial."
RuntimeError : "Your Trial Period has expired. Please purchase a key."
RuntimeError : "Your Key has expired. Please purchase a new key."
RuntimeError : "The Network you are using in unknown and key cannot be secured. Please change networks."
RuntimeError : "Your Key is being used on a different network than it was registered on. Please use your original network or purchase a new key for this network."
ValueError : "IP list was not specified."
ValueError : "Key was not specified."หากคุณได้รับข้อผิดพลาดเช่น:
RuntimeError : "Something went really wrong. Either the IP does not exist in the database, server is down, or another error occured. Check x.x.x.x.json for more details and file an issue if you are unable to solve the problem."ยื่นปัญหาเพื่อให้ทีมของเราสามารถช่วยเหลือคุณได้