MCPcopy Create free account
hub / github.com/Python3WebSpider/ProxyPool / getChinaIP

Function getChinaIP

examples/usage2.py:16–21  ·  view source on GitHub ↗
(ip='127.0.0.1')

Source from the content-addressed store, hash-verified

14# 爬数据的线程类
15
16def getChinaIP(ip='127.0.0.1'):
17 reader = geolite2.reader()
18 ip_info = reader.get(ip)
19 geolite2.close()
20 print(ip_info)
21 return True if ip_info['country']['iso_code'] == 'CN' else False
22
23
24

Callers 1

runMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected