Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 981 Bytes

README.md

File metadata and controls

29 lines (22 loc) · 981 Bytes

IPs by country

This project aims to provide a suite of scripts to retrieve ips by country.
When available you can also get IPs used by a specific ISP.

Usage

  • Get all IPs from France: python query.py --country fr
  • Get all IPs from Online in France: python query.py --country fr --search online

Install environment and fetch the data (optional)

The code has been tested with Python 3 and it depends on Scrapy. It is not a necessary step: all the stuff is already committed.

python3 -m venv env
source env/bin/activate
pip install -r requirements.txt

Now, you can get fresh data by running Scrapy.

  1. The first script fetches IPs in the CSV format (raw directory).
  2. The second one generates a binary ips-by-country.p) with all the data.
  3. It builds the markdown pages for each country (countries directory).
scrapy runspider --nolog ip_spider.py
python parse.py