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.
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/PKG-INFO +1 -1
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/pyproject.toml +1 -1
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/scrape_cli/__init__.py +1 -1
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/scrape_cli/scrape.py +3 -3
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/scrape_cli.egg-info/PKG-INFO +1 -1
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/tests/test_scrape.py +1 -1
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/README.md +0 -0
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/scrape_cli.egg-info/SOURCES.txt +0 -0
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/scrape_cli.egg-info/dependency_links.txt +0 -0
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/scrape_cli.egg-info/entry_points.txt +0 -0
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/scrape_cli.egg-info/requires.txt +0 -0
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/scrape_cli.egg-info/top_level.txt +0 -0
- {scrape_cli-1.2.3 → scrape_cli-1.2.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scrape_cli
|
|
3
|
-
Version: 1.2.
|
|
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
|
|
@@ -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
|
-
|
|
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
|
+
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 "
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|