Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests, re
- headers = {
- 'User-Agent': "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36 OPR/41.0.2353.56"
- }
- r = requests.get("http://ipinfo.io/AS19541")
- # print(r.text)
- match = re.findall('(?:\d{1,3}\.){3}\d{1,3}/\d{1,2}', r.text)
- if match:
- # netblocks = match.group()
- print(match)
- for netblock in match:
- print("/ip firewall address-list add address=%s list=ea-netblocks" % netblock)
- else:
- print("Nothing found.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement