scrape-cli 1.2.3__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scrape_cli
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: It's a command-line tool to extract HTML elements using an XPath query or CSS3 selector.
5
5
  Author-email: Andrea Borruso <aborruso@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/aborruso/scrape-cli
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "scrape_cli"
7
- version = "1.2.3"
7
+ version = "1.2.4"
8
8
  description = "It's a command-line tool to extract HTML elements using an XPath query or CSS3 selector."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -4,7 +4,7 @@ scrape-cli - A command-line tool to extract HTML elements using XPath or CSS3 se
4
4
 
5
5
  from scrape_cli.scrape import main
6
6
 
7
- __version__ = "1.2.3"
7
+ __version__ = "1.2.4"
8
8
  __author__ = "Andrea Borruso"
9
9
  __author_email__ = "aborruso@gmail.com"
10
10
 
@@ -116,7 +116,8 @@ examples:
116
116
 
117
117
  # Check for incorrect argument order (-eb instead of -be)
118
118
  if '-eb' in ' '.join(sys.argv):
119
- sys.exit("Error: The correct order is -be (body first, then expression). Please use -be instead of -eb.")
119
+ print("Error: use -be not -eb.\n scrape -be \"//article\" file.html", file=sys.stderr)
120
+ sys.exit(1)
120
121
  # Defines the HTML input argument (can be a file, URL or stdin)
121
122
  parser.add_argument('html', nargs='?', type=str, default='',
122
123
  help="HTML input (file, URL or stdin, default: stdin)", metavar="HTML")
@@ -133,12 +134,11 @@ examples:
133
134
  parser.add_argument('-e', '--expression', default=[], action='append',
134
135
  help="XPath query or CSS3 selector")
135
136
  # Option to verify the existence of elements matching the expression
136
- parser.add_argument('-x', '--check_existence', action='store_true', default=False,
137
+ parser.add_argument('-x', '--check-existence', dest='check_existence', action='store_true', default=False,
137
138
  help="Returns an exit value indicating existence")
138
139
  # Option to avoid initial HTML parsing, useful in specific cases like CData
139
140
  parser.add_argument('-r', '--rawinput', action='store_true', default=False,
140
141
  help="Do not parse HTML before passing to etree (useful for CData)")
141
- parser.add_argument('--check-existence', dest='check_existence', action='store_true')
142
142
  parser.add_argument('-u', '--user-agent', default=None,
143
143
  help="Custom User-Agent string for HTTP requests")
144
144
  args = parser.parse_args()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scrape_cli
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: It's a command-line tool to extract HTML elements using an XPath query or CSS3 selector.
5
5
  Author-email: Andrea Borruso <aborruso@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/aborruso/scrape-cli
@@ -179,7 +179,7 @@ def test_incorrect_eb_order_exits_with_specific_message():
179
179
  result = run_scrape("-eb")
180
180
 
181
181
  assert result.returncode == 1
182
- assert "Please use -be instead of -eb." in result.stderr
182
+ assert "use -be not -eb" in result.stderr
183
183
 
184
184
 
185
185
  def test_invalid_css_selector_fails_conversion():
File without changes
File without changes