scrapy / scrapely

A pure-python HTML screen-scraping library
1.86k stars 315 forks source link

Some usability improvements for the cmdline tool #56

Closed eliasdorneles closed 9 years ago

eliasdorneles commented 10 years ago

I was playing around with scrapely cmdline tool, and I found out that it does not forgive an user error very much. =) Here is my attempt to improve things a little bit.

Summary of the changes:

  1. Changed all commands to a descriptive form, keeping previous command names as aliases. As the cmd module has some basic autocomplete, long descriptive names work better specially for the first-time user.
  2. Alert the user when he forgets to provide a _templateid instead of exiting the session
  3. Attempts to fix incomplete URLs like www.example.com instead of http://www.example.com
  4. Removed test command method, keeping backwards compatibility using an alias for the annotate command (which does the same thing when no field name is given).

This is a bit rough, but it should help to improve things a little. Please let me know if you have any suggestion for improvements.

kmike commented 9 years ago

+1 to merge these changes once print is updated to use Python 3 compatible syntax.

eliasdorneles commented 9 years ago

cool! lemme rebase it!

eliasdorneles commented 9 years ago

@kmike done!