Package: linkGrabber
============Link Grabber============.. image:: https://travis-ci.org/michigan-com/linkGrabber.svg?branch=master:target: https://travis-ci.org/michigan-com/linkGrabberLink Grabber provides a quick and easy way to grab links froma single web page.  This python package is a simple wrapperaround `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_, focusing on grabbing HTML'shyperlink tag, "a."Dependecies:*  Python 2.7, 3.3, 3.4*  BeautifulSoup*  Requests*  SixHow-To------.. code:: bash$ python setup.py installOR.. code:: bash$ pip install linkGrabberQuickie-------.. code:: pythonimport reimport linkGrabberlinks = linkGrabber.Links("http://www.google.com")links.find()# limit the number of "a" tags to 5links.find(limit=5)# filter the "a" tag href attributelinks.find(href=re.compile("plus.google.com"))Documentation-------------http://linkgrabber.neurosnap.net/find````Parameters:*  filters (dict): Beautiful Soup's filters as a dictionary*  limit (int):  Limit the number of links in sequential order*  reverse (bool): Reverses how the list of <a> tags are sorted*  sort (function):  Accepts a function that accepts which key to sort uponwithin the List classFind all links that have a style containing "11px".. code:: pythonimport refrom linkGrabber import Linkslinks = Links("http://www.google.com")links.find(style=re.compile("11px"), limit=5)Reverse the sort before limiting links:.. code:: pythonfrom linkGrabber import Linkslinks = Links("http://www.google.com")links.find(limit=2, reverse=True)Sort by a link's  attribute:.. code:: pythonfrom linkGrabber import Linkslinks = Links("http://www.google.com")links.find(limit=3, sort=lambda key: key['text'])Exclude text:.. code:: pythonimport refrom linkGrabber import Linkslinks = Links("http://www.google.com")links.find(exclude=[{ "text": re.compile("Read More") }])Remove duplicate URLs and make the output pretty:.. code:: pythonfrom linkGrabber import Linkslinks = Links("http://www.google.com")links.find(duplicates=False, pretty=True)Link Dictionary```````````````All attrs from BeautifulSoup's Tag object are available in the dictionaryas well as a few extras:*  text (text inbetween the <a></a> tag)*  seo (parse all text after last "/" in URL and attempt to make it human readable)=========Changelog=========v0.3.1 (11/09/2017)-------------------* :bug: `find` would fail when not providing a `href` property [6](https://github.com/michigan-com/linkGrabber/pull/6) @MohamedHuzienv.0.3.0 (7/09/2015)-------------------* Added parser parameter to Links class* Default parser set to lxmlv.0.2.10 (7/09/2015-------------------* Added six as a dependencyv0.2.9 (1/24/2014)------------------* Updated documentationv0.2.8 (10/23/2014)-------------------* Added better documentationv0.2.7 (06/25/2014)-------------------* Fixed exclude for non-iterable stringsv0.2.6 (06/25/2014)-------------------* Exclude parameter is now a list of dictionaries* Added pretty property* Added duplicates property which will remove any identical URLs* Added more tests* Added better docsv0.2.5 (06/23/2014)-------------------* Added exclude parameter to Links.find() which removeslinks that match certain criteriav0.2.4 (06/10/2014)-------------------* Updated documentation to be better read on pypi* Removed scrape.py and moved it to __init__.py* Now using nose for unit testingv0.2.3 (05/22/2014)-------------------* Updated setup py file and some verbagev0.2.2 (05/19/2014)-------------------* linkGrabber.Links.find() now responds with all Tag.attrsfrom BeautifulSoup4 as well as 'text' and 'seo' keysv0.2.1 (05/18/2014)-------------------* Added more testsv0.2.0 (05/17/2014)-------------------* Modified naming convention, reduced codebase, more readable structurev0.1.9 (05/17/2014)-------------------* Python 3.4 compatabilityv0.1.8 (05/16/2014)-------------------* Changed paramerter names to better reflect functionalityv0.1.7 (05/16/2014)-------------------* Update READMEv0.1.6 (05/16/2014)-------------------* Update README with more examplesv0.1.5 (05/16/2014)-------------------* Updated find_links to accept link_reverse=(bool) and link_sort=(function)v0.1.0 (05/16/2014)-------------------* Initial release.