Skip to content

Instantly share code, notes, and snippets.

View raywang5288's full-sized avatar

WangLei raywang5288

  • Xidian Universety
  • XiAn
View GitHub Profile
@raywang5288
raywang5288 / gist:ba2f553a6396e4ec3c2e4570cb869924
Created January 9, 2018 06:46
爬虫五:本机IP查询
import requests
url = "http://m.ip138.com/ip.asp?ip="
ip = "61.150.43.68"
try:
r = requests.get(url+ip)
r.raise_for_status()
r.encoding = r.apparent_encoding
print(r.text[-500:])
except:
print("default")