warn-scraper 1.2.164.dev0__py3-none-any.whl → 1.2.166.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/al.py +15 -2
- {warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/METADATA +1 -1
- {warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/RECORD +9 -9
- warn_scraper-1.2.166.dev0.dist-info/scm_version.json +8 -0
- warn_scraper-1.2.164.dev0.dist-info/scm_version.json +0 -8
- {warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/WHEEL +0 -0
- {warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/entry_points.txt +0 -0
- {warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/licenses/LICENSE +0 -0
- {warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/scm_file_list.json +0 -0
- {warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/top_level.txt +0 -0
warn/scrapers/al.py
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import csv
|
|
2
2
|
import logging
|
|
3
|
+
import random
|
|
3
4
|
from io import StringIO
|
|
4
5
|
from pathlib import Path
|
|
6
|
+
from time import sleep
|
|
7
|
+
|
|
8
|
+
import niquests as requests
|
|
5
9
|
|
|
6
10
|
from .. import utils
|
|
7
11
|
from ..cache import Cache
|
|
@@ -41,8 +45,17 @@ def scrape(
|
|
|
41
45
|
# But say they won't for the CSV download which, OK.
|
|
42
46
|
# No headers on the CSV, which they'll probably realize ... sometime.
|
|
43
47
|
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
people_page = "https://workforce.alabama.gov/warn-list/"
|
|
49
|
+
data_page = "https://workforce.alabama.gov/documents/warn-list/"
|
|
50
|
+
|
|
51
|
+
session = requests.Session()
|
|
52
|
+
|
|
53
|
+
page = session.get(people_page).text
|
|
54
|
+
|
|
55
|
+
sleep(random.uniform(2, 4))
|
|
56
|
+
|
|
57
|
+
page = session.get(data_page).text
|
|
58
|
+
|
|
46
59
|
cache.write("al/rawcsv.csv", page)
|
|
47
60
|
|
|
48
61
|
headers = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: warn-scraper
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.166.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
|
|
@@ -13,7 +13,7 @@ warn/platforms/job_center/urls.py,sha256=IWhpuzN_xcNdHh23GbZPGvuHCsMcmb03qx3pRn1
|
|
|
13
13
|
warn/platforms/job_center/utils.py,sha256=HdUKgKirmpPP7e4Cu_ZyB3zPVS_p-_ylo-lXFhxK2QM,5696
|
|
14
14
|
warn/scrapers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
warn/scrapers/ak.py,sha256=h7BYMTV0whwWAPhbzVDVKMMoVCFphKly70aiTHabPq4,1847
|
|
16
|
-
warn/scrapers/al.py,sha256=
|
|
16
|
+
warn/scrapers/al.py,sha256=i2f4sm-Wj70T67dY-ek7p0lGuu72njpIxleyU45pSwg,2137
|
|
17
17
|
warn/scrapers/az.py,sha256=elGbue01Gjf_DQ66Wy9qqGIOJsiY-KIKJOVeft8pCXg,1447
|
|
18
18
|
warn/scrapers/ca.py,sha256=VQOfjHXPCc-jYwh-EPGVVfnzvXB7pdmCt2uJ6QnMPRM,8600
|
|
19
19
|
warn/scrapers/co.py,sha256=83OdikIrWGxt22mlI-_zLSNqJg1NO5C2Xjm3FF6DPYY,18252
|
|
@@ -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.166.dev0.dist-info/licenses/LICENSE,sha256=ZV-QHyqPwyMuwuj0lI05JeSjV1NyzVEk8Yeu7FPtYS0,585
|
|
58
|
+
warn_scraper-1.2.166.dev0.dist-info/METADATA,sha256=CheNga303pGfguFCESkHrJ6Z1dUSRRecCc3hx8PQdFU,1780
|
|
59
|
+
warn_scraper-1.2.166.dev0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
60
|
+
warn_scraper-1.2.166.dev0.dist-info/entry_points.txt,sha256=poh_oSweObGlBSs1_2qZmnTodlOYD0KfO7-h7W2UQIw,47
|
|
61
|
+
warn_scraper-1.2.166.dev0.dist-info/scm_file_list.json,sha256=SBROd7oEfcspIMl6v7yfGzQd2rkWxybkiIXopuTQVL0,4120
|
|
62
|
+
warn_scraper-1.2.166.dev0.dist-info/scm_version.json,sha256=DCaavLmhxzPrXZffq76625Uj25f6cVWifQ75uWMhsVM,161
|
|
63
|
+
warn_scraper-1.2.166.dev0.dist-info/top_level.txt,sha256=dZfms6N3kqVXufiPOo7YqOrAcUtYfNH_oyGvYUk9FB4,5
|
|
64
|
+
warn_scraper-1.2.166.dev0.dist-info/RECORD,,
|
|
File without changes
|
{warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{warn_scraper-1.2.164.dev0.dist-info → warn_scraper-1.2.166.dev0.dist-info}/scm_file_list.json
RENAMED
|
File without changes
|
|
File without changes
|