diff --git a/city_scrapers/spiders/chi_ssa_35.py b/city_scrapers/spiders/chi_ssa_35.py new file mode 100644 index 000000000..811c941d4 --- /dev/null +++ b/city_scrapers/spiders/chi_ssa_35.py @@ -0,0 +1,144 @@ +from datetime import datetime, timedelta + +from city_scrapers_core.constants import COMMISSION +from city_scrapers_core.items import Meeting +from city_scrapers_core.spiders import CityScrapersSpider + + +class ChiSsa35Spider(CityScrapersSpider): + name = "chi_ssa_35" + agency = "Chicago Special Service Area #35 Lincoln Ave" + timezone = "America/Chicago" + start_urls = [ + "https://www.lincolnparkchamber.com/" + + "businesses/special-service-areas/lincoln-avenue-ssa/ssa-administration/" + ] + + def parse(self, response): + _year = None + _type = "" + _description = "" + + content_div = response.css("div.content_block.content.background_white") + inner_elements = content_div.css("h4, li, p") + + for element in inner_elements: + meeting_content = {} + + if "

" in element.get(): + # Type here could be Schedule, Agendas or Minutes + title = element.css("::text").get().split() + _type = title[-1] + try: + _year = int(title[0]) + except ValueError: + _year = None + + if "

" in element.get(): + # The encode part here is to remove \xa0 and other characters like that + _description = ( + element.css("::text").get().encode("ascii", "ignore").decode() + ) + + if "

  • " in element.get(): + meeting_content["date"] = element.css("::text").get() + if "href" in element.get(): + meeting_content["url"] = element.css("a::attr(href)").get() + + if "

    + + + + + + SSA Administration - Lincoln Park Chamber of Commerce + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + +
    +
    +
    +

    Lincoln Avenue SSA Administration

    +
    +
    +
    + +
    + +
    +
    +
    +
    +

    2021 Lincoln Avenue SSA Commission Meeting Schedule

    +

    All meetings held at 9:00 am. Meetings typically run 90 minutes. Please contact the LPCC to confirm meeting locations (773) 880-5200.

    +
      +
    1. Tuesday, January 26
    2. +
    3. Tuesday, April 20
    4. +
    5. Tuesday, May 18
    6. +
    7. Tuesday, July 13
    8. +
    9. Tuesday, September 14
    10. +
    11. Tuesday, November 16
    12. +
    +

    2021 Lincoln Avenue SSA Commission Meeting Agendas

    +
      +
    1. Tuesday, January 26
    2. +
    3. Tuesday, April 20
    4. +
    5. Tuesday, May 18
    6. +
    7. Tuesday, July 13
    8. +
    9. Tuesday, September 14
    10. +
    11. Tuesday, November 16
    12. +
    +

    2020 Lincoln Avenue SSA Commission Meeting Schedule

    +

    All meetings held at 9:00 am. Meetings typically run 90 minutes. Please contact the LPCC to confirm meeting locations (773) 880-5200.

    +
      +
    1. Tuesday, January 28
    2. +
    3. Tuesday, March 24 (10:37 am)
    4. +
    5. Tuesday, April 7 (9:45 am)
    6. +
    7. Thursday, April 23
    8. +
    9. Thursday, May 7 (10:00 am)
    10. +
    11. Thursday, May 28
    12. +
    13. Thursday, June 11
    14. +
    15. Tuesday, June 23
    16. +
    17. Thursday, July 9
    18. +
    19. Thursday, September 17
    20. +
    21. Thursday, November 12
    22. +
    +

    2020 Lincoln Avenue SSA Commission Meeting Agendas

    +

    January 28, 2020

    +

    March 24, 2020

    +

    April 7, 2020

    +

    April 23, 2020

    +

    May 7, 2020

    +

    May 28, 2020

    +

    June 11, 2020

    +

    June 23, 2020

    +

    July 9, 2020

    +

    September 17, 2020

    +

    November 12 2020

    +

    2020 Lincoln Avenue SSA Commission Meeting Minutes

    +

    January 28, 2020

    +

    March 24, 2020

    +

    April 07, 2020

    +

    April 23, 2020

    +

    May 7, 2020

    +

    May 28, 2020

    +

    June 11, 2020

    +

    June 23, 2020

    +

    July 9, 2020

    +

    September 17, 2020

    +

    2019 Lincoln Avenue SSA Commission Meeting Agendas

    +

    January 24, 2019

    +

    April 25, 2019

    +

    May 16, 2019

    +

    July 11, 2019

    +

    September 19, 2019

    +

    November 21, 2019

    +

    2019 Lincoln Avenue SSA Commission Meeting Minutes

    +

    January 24, 2019

    +

    April 25, 2019

    +

    May 16, 2019

    +

    July 11, 2019

    +

    September 19, 2019

    +

    November 21, 2019

    +

    2018 Lincoln Avenue SSA Commission Meeting Agendas

    +

    November 15, 2018

    +

    September 13, 2018

    +

    July 12, 2018

    +

    May 17, 2018

    +

    April 12, 2018

    +

    January 25, 2018

    +

    2017 Lincoln Avenue SSA Commission Meeting Agendas

    +

    November 9, 2017

    +

    September 14, 2017

    +

    July 13, 2017

    +

    May 18, 2017

    +

    April 27, 2017

    +

    February 2, 2017

    +

    2018 Lincoln Avenue SSA Commission Meeting Minutes

    +

    November 15, 2018

    +

    September 13, 2018

    +

    July 12, 2018

    +

    May 17, 2018

    +

    April 12, 2018

    +

    January 25, 2018

    +

    2017 Lincoln Avenue SSA Commission Meeting Minutes

    +

    September 14, 2017

    +

    July 13, 2017

    +

    May 18, 2017

    +

    April 27, 2017

    +

    February 2, 2017

    +

     

    +

    To view the 2019 Lincoln Avenue Special Service Area #35 Service Provider Agreement, click here.

    +

     

    +

    Current Request for Proposals

    +

    The Lincoln Park Chamber of Commerce is not currently accepting bids for services.

    +

     

    + +
    +
    +
    + +
    + + + +
    + + + + +
    + + +
    +
    + + +
    + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/test_chi_ssa_35.py b/tests/test_chi_ssa_35.py new file mode 100644 index 000000000..4e6e14a7f --- /dev/null +++ b/tests/test_chi_ssa_35.py @@ -0,0 +1,73 @@ +from datetime import datetime +from os.path import dirname, join + +import pytest +from city_scrapers_core.constants import COMMISSION +from city_scrapers_core.utils import file_response +from freezegun import freeze_time + +from city_scrapers.spiders.chi_ssa_35 import ChiSsa35Spider + +test_response = file_response( + join(dirname(__file__), "files", "chi_ssa_35.html"), + url="https://www.lincolnparkchamber.com/businesses/" + + "special-service-areas/lincoln-avenue-ssa/ssa-administration/", +) +spider = ChiSsa35Spider() + +freezer = freeze_time("2021-1-17") +freezer.start() + +parsed_items = [item for item in spider.parse(test_response)] + +freezer.stop() + + +def test_title(): + assert parsed_items[0]["title"] == "Commission" + + +def test_start(): + assert parsed_items[0]["start"] == datetime(2021, 1, 26) + + +def test_time_notes(): + assert parsed_items[0]["time_notes"] == "" + + +def test_id(): + assert parsed_items[0]["id"] == "chi_ssa_35/202101260000/x/commission" + + +def test_status(): + assert parsed_items[0]["status"] == "tentative" + + +def test_location(): + assert parsed_items[0]["location"] == { + "name": "Confirm with agency", + "address": "", + } + + +def test_source(): + assert ( + parsed_items[0]["source"] + == "https://www.lincolnparkchamber.com/businesses/" + + "special-service-areas/lincoln-avenue-ssa/ssa-administration/" + ) + + +def test_links(): + assert parsed_items[0]["links"] == [ + {"href": None, "title": "Tuesday January 26 2021"} + ] + + +def test_classification(): + assert parsed_items[0]["classification"] == COMMISSION + + +@pytest.mark.parametrize("item", parsed_items) +def test_all_day(item): + assert item["all_day"] is False