warn-scraper 1.2.159.dev0__py3-none-any.whl → 1.2.160.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/md.py +9 -0
- {warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/METADATA +1 -1
- {warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/RECORD +9 -9
- warn_scraper-1.2.160.dev0.dist-info/scm_version.json +8 -0
- warn_scraper-1.2.159.dev0.dist-info/scm_version.json +0 -8
- {warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/WHEEL +0 -0
- {warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/entry_points.txt +0 -0
- {warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/licenses/LICENSE +0 -0
- {warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/scm_file_list.json +0 -0
- {warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/top_level.txt +0 -0
warn/scrapers/md.py
CHANGED
|
@@ -61,6 +61,8 @@ def scrape(
|
|
|
61
61
|
html_list.append(html) # Save the source HTML for parsing also
|
|
62
62
|
|
|
63
63
|
old_pages = [
|
|
64
|
+
"warn2025.shtml",
|
|
65
|
+
"warn2024.shtml",
|
|
64
66
|
"warn2023.shtml",
|
|
65
67
|
"warn2022.shtml",
|
|
66
68
|
"warn2021.shtml",
|
|
@@ -83,6 +85,7 @@ def scrape(
|
|
|
83
85
|
filename = f"md/{href}.html"
|
|
84
86
|
|
|
85
87
|
if href not in old_pages:
|
|
88
|
+
logger.debug(f"Trying special handling on {href}")
|
|
86
89
|
sleep(naptime) # Try to stop blocked connections by being less aggressive
|
|
87
90
|
r = utils.get_url(url, headers=request_headers, verify=request_verify)
|
|
88
91
|
r.encoding = "utf-8"
|
|
@@ -116,6 +119,8 @@ def scrape(
|
|
|
116
119
|
row_list = table.find_all("tr")
|
|
117
120
|
|
|
118
121
|
# If it's not the first page, slice off the header
|
|
122
|
+
if i == 0:
|
|
123
|
+
logger.debug(f"Found possible header row: {row_list[0]}")
|
|
119
124
|
if i > 0:
|
|
120
125
|
row_list = row_list[1:]
|
|
121
126
|
|
|
@@ -123,6 +128,10 @@ def scrape(
|
|
|
123
128
|
for row in row_list:
|
|
124
129
|
# Get the cells
|
|
125
130
|
cell_list = row.find_all("td")
|
|
131
|
+
if not cell_list:
|
|
132
|
+
cell_list = row.find_all(
|
|
133
|
+
"th"
|
|
134
|
+
) # Alternate approach for first page's header
|
|
126
135
|
|
|
127
136
|
# Clean them up
|
|
128
137
|
cell_list = [_clean_text(c.text) for c in cell_list]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: warn-scraper
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.160.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
|
|
@@ -30,7 +30,7 @@ warn/scrapers/in.py,sha256=0hOCdbUyls3xX7Q1z5OB6yCrXJFpsu2CmvfwRh9NTfY,2202
|
|
|
30
30
|
warn/scrapers/ks.py,sha256=F_3biEMF7zgCX2XVuUACR74Vyzapta4SaM9SY3EuZCU,1266
|
|
31
31
|
warn/scrapers/ky.py,sha256=7kJTNOzxChyXlcyBImmdwwmrczYksU8XNxbhQ2owmJs,9688
|
|
32
32
|
warn/scrapers/la.py,sha256=52i7ICYH0R7omFyu-kmKi_s-8Rhy0vaPjNIKlW_OMC8,6938
|
|
33
|
-
warn/scrapers/md.py,sha256=
|
|
33
|
+
warn/scrapers/md.py,sha256=Zjudr5X8-E3fjBXbOqnB830XEZqLznGzQbaJ5HSY0zQ,4425
|
|
34
34
|
warn/scrapers/me.py,sha256=q36F4yJ7hvZsLayA3uBS1romo4X3Qf-sEi2Y7LAQCi8,1172
|
|
35
35
|
warn/scrapers/mi.py,sha256=Ppyawp4nbzSBODuzDKeqnO9_9do5MFwK4Y_f3uc6blE,5846
|
|
36
36
|
warn/scrapers/mo.py,sha256=wnnwQAiVPwuheMqptMXZpyQdiKNghhKwTO-Bnh9oXoU,3492
|
|
@@ -54,11 +54,11 @@ warn/scrapers/va.py,sha256=7Nle7qL0VNPiE653XyaP9HQqSfuJFDRr2kEkjOqLvFM,11269
|
|
|
54
54
|
warn/scrapers/vt.py,sha256=d-bo4WK2hkrk4BhCCmLpEovcoZltlvdIUB6O0uaMx5A,1186
|
|
55
55
|
warn/scrapers/wa.py,sha256=UXdVtHZo_a-XfoiyOooTRfTb9W3PErSZdKca6SRORgs,4282
|
|
56
56
|
warn/scrapers/wi.py,sha256=ClEzXkwZbop0W4fkQgsb5oHAPUrb4luUPGV-jOKwkcg,4855
|
|
57
|
-
warn_scraper-1.2.
|
|
58
|
-
warn_scraper-1.2.
|
|
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.
|
|
57
|
+
warn_scraper-1.2.160.dev0.dist-info/licenses/LICENSE,sha256=ZV-QHyqPwyMuwuj0lI05JeSjV1NyzVEk8Yeu7FPtYS0,585
|
|
58
|
+
warn_scraper-1.2.160.dev0.dist-info/METADATA,sha256=eHYbY-2hpPWQAbxPEdBufp79t3vSb1e0gE0WPRKAtMY,1780
|
|
59
|
+
warn_scraper-1.2.160.dev0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
60
|
+
warn_scraper-1.2.160.dev0.dist-info/entry_points.txt,sha256=poh_oSweObGlBSs1_2qZmnTodlOYD0KfO7-h7W2UQIw,47
|
|
61
|
+
warn_scraper-1.2.160.dev0.dist-info/scm_file_list.json,sha256=SBROd7oEfcspIMl6v7yfGzQd2rkWxybkiIXopuTQVL0,4120
|
|
62
|
+
warn_scraper-1.2.160.dev0.dist-info/scm_version.json,sha256=BlfOZmrMfTxErAqmqWjuNwb0FtN0WDp9xyU4qysIay8,161
|
|
63
|
+
warn_scraper-1.2.160.dev0.dist-info/top_level.txt,sha256=dZfms6N3kqVXufiPOo7YqOrAcUtYfNH_oyGvYUk9FB4,5
|
|
64
|
+
warn_scraper-1.2.160.dev0.dist-info/RECORD,,
|
|
File without changes
|
{warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{warn_scraper-1.2.159.dev0.dist-info → warn_scraper-1.2.160.dev0.dist-info}/scm_file_list.json
RENAMED
|
File without changes
|
|
File without changes
|