Version 2.0 and higher of pybrowscap supports csv browscap file version 5000 and higher. If you want to use older version of csv browscap file, use pybrowscap version lower than 2.0.
Install via pypi or copy this module into your project or into your PYTHON_PATH. Download latest version of browscap.csv file from http://browsers.garykeith.com/downloads.asp.
from pybrowscap.loader.csv import load_file browscap = load_file(path_to_browscap_csv) browser = browscap.search(user_agent_string) browser.is_crawler()
from pybrowscap.loader import Downloader from pybrowscap.loader.csv import URL Downloader(URL).get(save_to_filepath)
Tested on evnironment
To run the test run command:
$ python test.py $ python setup.py test
Special thanks to these projects for inspiration: