Decorator for a dictionary of links. Each link is indexed by its
label. Allows the user to select links of interest and read each
selection into its own file. The filename is contructed by appending the
label with an extension of html.
Files can be selected by index, range or label. The destination
directory defaults to the current directory. The user can specify another
dictionary by passing a list of path segments to the constructor.
net_catch = NetCatch() net_catch = NetCatch( [ 'amylase', 'species' ]
) net_catch.get_all_urls() net_catch.get_urls_by_label( [ 'pig', 'dog',
'cow' ] ) net_catch.get_urls_by_index( [ 1, 4, 6, 9 ] )
net_catch.get_urls_by_range( 2, 5 )
Method Summary |
|
__init__(self,
path_segments)
|
|
__str__(self)
|
|
add_url(self,
label,
url)
|
|
get_all_urls(self)
|
|
get_urls_by_index(self,
indices)
|
|
get_urls_by_label(self,
labels)
|
|
get_urls_by_range(self,
low,
hi)
|
|
import_dict(self,
href_dict)
|