extend the output of '--list-extractors'
It now includes category and subcategory values for each extractor class.
This commit is contained in:
@@ -80,11 +80,14 @@ def main():
|
||||
print(module_name)
|
||||
elif args.list_extractors:
|
||||
for extr in extractor.extractors():
|
||||
if not extr.__doc__:
|
||||
continue
|
||||
print(extr.__name__)
|
||||
if extr.__doc__:
|
||||
print(extr.__doc__)
|
||||
print(extr.__doc__)
|
||||
print("Category:", extr.category,
|
||||
"- Subcategory:", extr.subcategory)
|
||||
if hasattr(extr, "test") and extr.test:
|
||||
print("Example:", extr.test[0][0])
|
||||
print("Example :", extr.test[0][0])
|
||||
print()
|
||||
else:
|
||||
if not args.urls and not args.inputfile:
|
||||
|
||||
@@ -152,7 +152,7 @@ def build_parser():
|
||||
parser.add_argument(
|
||||
"--list-extractors", dest="list_extractors", action="store_true",
|
||||
help=("Print a list of extractor classes "
|
||||
"with description and example URL"),
|
||||
"with description, (sub)category and example URL"),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--list-keywords", dest="list_keywords", action="store_true",
|
||||
|
||||
Reference in New Issue
Block a user