warn-scraper 1.2.170.dev0__py3-none-any.whl → 1.2.172.dev0__py3-none-any.whl
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.
- warn/scrapers/oh.py +7 -2
- warn/utils.py +3 -2
- {warn_scraper-1.2.170.dev0.dist-info → warn_scraper-1.2.172.dev0.dist-info}/METADATA +1 -1
- {warn_scraper-1.2.170.dev0.dist-info → warn_scraper-1.2.172.dev0.dist-info}/RECORD +8 -8
- {warn_scraper-1.2.170.dev0.dist-info → warn_scraper-1.2.172.dev0.dist-info}/WHEEL +0 -0
- {warn_scraper-1.2.170.dev0.dist-info → warn_scraper-1.2.172.dev0.dist-info}/entry_points.txt +0 -0
- {warn_scraper-1.2.170.dev0.dist-info → warn_scraper-1.2.172.dev0.dist-info}/licenses/LICENSE +0 -0
- {warn_scraper-1.2.170.dev0.dist-info → warn_scraper-1.2.172.dev0.dist-info}/top_level.txt +0 -0
warn/scrapers/oh.py
CHANGED
|
@@ -4,7 +4,7 @@ import re
|
|
|
4
4
|
from io import StringIO
|
|
5
5
|
from pathlib import Path
|
|
6
6
|
|
|
7
|
-
import requests
|
|
7
|
+
import niquests as requests # Avoid some detection schemes
|
|
8
8
|
|
|
9
9
|
from .. import utils
|
|
10
10
|
from ..cache import Cache
|
|
@@ -48,7 +48,12 @@ def scrape(
|
|
|
48
48
|
cache.write("oh/index.html", r.text)
|
|
49
49
|
logger.debug("Attempting to get CSV link from Ohio file")
|
|
50
50
|
html = r.text
|
|
51
|
-
|
|
51
|
+
try:
|
|
52
|
+
csv_url = re.findall(r"(\\\"csvUrl\\\":\\\")(.*?)(\\\")", html)[0][1]
|
|
53
|
+
except IndexError:
|
|
54
|
+
logger.debug(f"csvUrl not found. Response code: {r.status_code}")
|
|
55
|
+
logger.error(html)
|
|
56
|
+
|
|
52
57
|
logger.debug(f"CSV link found at {csv_url}")
|
|
53
58
|
r = requests.get(csv_url, headers=headers)
|
|
54
59
|
cache.write("oh/rawdata.csv", r.text)
|
warn/utils.py
CHANGED
|
@@ -281,8 +281,9 @@ def write_disparate_dict_rows_to_csv(
|
|
|
281
281
|
if item not in headers and item not in headerextras:
|
|
282
282
|
prefixhere = False
|
|
283
283
|
for prefix in prefixes:
|
|
284
|
-
if item
|
|
285
|
-
|
|
284
|
+
if item:
|
|
285
|
+
if item.startswith(prefix):
|
|
286
|
+
prefixhere = True
|
|
286
287
|
if prefixhere:
|
|
287
288
|
headerextras.append(item)
|
|
288
289
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: warn-scraper
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.172.dev0
|
|
4
4
|
Summary: Command-line interface for downloading WARN Act notices of qualified plant closings and mass layoffs from state government websites
|
|
5
5
|
Author-email: Big Local News <biglocalnews@stanford.edu>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -2,7 +2,7 @@ warn/__init__.py,sha256=A07JFY1TyaPtVIndBa7IvTk13DETqIkLgRdk0A-MCoE,85
|
|
|
2
2
|
warn/cache.py,sha256=QBSHycchvRTkOQfHptOtZeTYiPgLP383jS8MTiGln_c,5969
|
|
3
3
|
warn/cli.py,sha256=ZqyJwICdHFkn2hEgbArj_upbElR9-TSDlYDqyEGeexE,2019
|
|
4
4
|
warn/runner.py,sha256=oeGRybGwpnkQKlPzRMlKxhsDt1GN4PZoX-vUwrsPgos,1894
|
|
5
|
-
warn/utils.py,sha256=
|
|
5
|
+
warn/utils.py,sha256=MMl-v09XIPKYWm7o-NMF-01so15V0_dMDq0gAjtqwKM,13526
|
|
6
6
|
warn/pdfrodent/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
warn/pdfrodent/pdfrodent.py,sha256=S2LXkKOdP0Jqzcg10hzGijTu83TMS72DzZqQceslJ70,14914
|
|
8
8
|
warn/platforms/__init__.py,sha256=wIZRDf4tbTuC8oKM4ZrTAtwNgbtMQGzPXMwDYCFyrog,81
|
|
@@ -42,7 +42,7 @@ warn/scrapers/ne.py,sha256=JawuGJ3tCKvMd-N-p03gnltB4rol4QUJshMk2oyMPO4,4143
|
|
|
42
42
|
warn/scrapers/nj.py,sha256=nwbMbeQuUJbYRVoyUyKZBmNqvqsXu3Habt-10r8DvZE,2230
|
|
43
43
|
warn/scrapers/nm.py,sha256=55kDh65uOc-uMO8wuxPHhHN4Aw8Di2Fx66JBds8f2Io,3694
|
|
44
44
|
warn/scrapers/ny.py,sha256=_nYoawIde4yYtk8-tMG3hekLlSlrKKqULmkBWOUoQJM,2586
|
|
45
|
-
warn/scrapers/oh.py,sha256=
|
|
45
|
+
warn/scrapers/oh.py,sha256=FHn73DES10zLZUSdUbfLJh9QMNsms3XGgYpUxPf8OvA,3684
|
|
46
46
|
warn/scrapers/ok.py,sha256=ZZciyR1jPS4SzS2JSQwhJsDXP_VxA9UkEQvLpxzWzp4,7676
|
|
47
47
|
warn/scrapers/or.py,sha256=0PjyrW3CHdxtHhqEo3Ob-9B6YckACoBD3K0c4FPQUcg,5208
|
|
48
48
|
warn/scrapers/pa.py,sha256=j6cYZjKJUht2s829VPAbI2IRJazkqOwbwcVMAcItuIc,5410
|
|
@@ -56,9 +56,9 @@ warn/scrapers/va.py,sha256=7Nle7qL0VNPiE653XyaP9HQqSfuJFDRr2kEkjOqLvFM,11269
|
|
|
56
56
|
warn/scrapers/vt.py,sha256=d-bo4WK2hkrk4BhCCmLpEovcoZltlvdIUB6O0uaMx5A,1186
|
|
57
57
|
warn/scrapers/wa.py,sha256=UXdVtHZo_a-XfoiyOooTRfTb9W3PErSZdKca6SRORgs,4282
|
|
58
58
|
warn/scrapers/wi.py,sha256=ClEzXkwZbop0W4fkQgsb5oHAPUrb4luUPGV-jOKwkcg,4855
|
|
59
|
-
warn_scraper-1.2.
|
|
60
|
-
warn_scraper-1.2.
|
|
61
|
-
warn_scraper-1.2.
|
|
62
|
-
warn_scraper-1.2.
|
|
63
|
-
warn_scraper-1.2.
|
|
64
|
-
warn_scraper-1.2.
|
|
59
|
+
warn_scraper-1.2.172.dev0.dist-info/licenses/LICENSE,sha256=ZV-QHyqPwyMuwuj0lI05JeSjV1NyzVEk8Yeu7FPtYS0,585
|
|
60
|
+
warn_scraper-1.2.172.dev0.dist-info/METADATA,sha256=K3c-r2nVvlbivhN7u2BgN7lh6Jgh9U_ICpXa_kYrY9s,1780
|
|
61
|
+
warn_scraper-1.2.172.dev0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
62
|
+
warn_scraper-1.2.172.dev0.dist-info/entry_points.txt,sha256=poh_oSweObGlBSs1_2qZmnTodlOYD0KfO7-h7W2UQIw,47
|
|
63
|
+
warn_scraper-1.2.172.dev0.dist-info/top_level.txt,sha256=dZfms6N3kqVXufiPOo7YqOrAcUtYfNH_oyGvYUk9FB4,5
|
|
64
|
+
warn_scraper-1.2.172.dev0.dist-info/RECORD,,
|
|
File without changes
|
{warn_scraper-1.2.170.dev0.dist-info → warn_scraper-1.2.172.dev0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{warn_scraper-1.2.170.dev0.dist-info → warn_scraper-1.2.172.dev0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|