예제 #1
0
 def get_session_list(self):
     sessions = url_xpath('https://www.legislature.ohio.gov/legislation/search'
                          '?generalAssemblies=133&pageSize=10&start=1&isInitial=true',
                          '//div[@id="generalAssemblyValues"]//'
                          'div[contains(@class, "optionLabel")]/text()')
     # Archive does not include current session
     return sessions
예제 #2
0
 def get_session_list(self):
     sessions = url_xpath(
             'http://legislature.vermont.gov/bill/search/2016',
             '//fieldset/div[@id="Form_SelectSession_selected_session_Holder"]'
             '/div/select/option/text()')
     sessions = (session.replace(',', '').strip() for session in sessions)
     return sessions
예제 #3
0
 def get_session_list(self):
     from openstates.utils import url_xpath
     sessions = url_xpath('http://webserver1.lsb.state.ok.us/WebApplication2/WebForm1.aspx',
                          "//select[@name='cbxSession']/option/text()")
     # OK Sometimes appends (Mainsys) to their session listings
     sessions = [s.replace('(Mainsys)', '').strip() for s in sessions]
     return sessions
예제 #4
0
 def get_session_list(self):
     sessions = url_xpath('http://archives.legislature.state.oh.us',
                          '//form[@action="bill_search.cfm"]//input[@type="radio"'
                          ' and @name="SESSION"]/@value')
     # Archive does not include current session
     sessions.append('131')
     return sessions
예제 #5
0
 def _add_agenda_list(self, url, event):
     trs = url_xpath(url, "//tr")
     for tr in trs:
         things = tr.xpath("./td/a")
         for thing in things:
             event = self._add_agenda_real(thing.attrib['href'], event)
     return event
예제 #6
0
 def get_session_list(self):
     return [session['_scraped_name']
             for session in self.legislative_sessions]
     return url_xpath(
         'https://www.akleg.gov/basis/Home/Archive',
         '//div[@id="fullpage"]//a[contains(@href, "/BillsandLaws/")]//text()'
     )
예제 #7
0
 def get_session_list(self):
     sessions = url_xpath(
         'http://www.leginfo.ca.gov/bilinfo.html',
         "//select[@name='sess']/option/text()")
     return [
         re.findall('\(.*\)', session)[0][1:-1]
         for session in sessions
     ]
예제 #8
0
    def get_session_list(self):
        # PA keeps slowly adding backdata, so just ignore it en masse
        for i in range(1800, 2000):
            self.ignored_scraped_sessions.append('{} Regular Session'.format(i))
            self.ignored_scraped_sessions.append('{} Special Session #1'.format(i))

        return url_xpath('http://www.legis.state.pa.us/cfdocs/legis/home/bills/',
                         '//select[@id="billSessions"]/option/text()')
예제 #9
0
def get_postable_subjects():
    global subjects
    if subjects is None:
        subs = url_xpath(
            "http://status.rilin.state.ri.us/",
            "//select[@id='rilinContent_cbCategory']"
        )[0].xpath("./*")
        subjects = {o.text: o.attrib['value'] for o in subs}
        subjects.pop(None)
    return subjects
예제 #10
0
    def get_session_list(self):
        sessions = url_xpath(
            'https://www.legis.iowa.gov/legislation/findLegislation',
            "//section[@class='grid_6']//li/a/text()[normalize-space()]"
        )

        return [x[0] for x in filter(lambda x: x != [], [
            re.findall(r'^.*Assembly: [0-9]+', session)
            for session in sessions
        ])]
예제 #11
0
    def get_session_list(self):
        sessions = url_xpath(
            'http://www.lrc.ky.gov/legislation.htm',
            '//a[contains(@href, "record.htm")]/text()[normalize-space()]')

        for index, session in enumerate(sessions):
            # Remove escaped whitespace characters.
            sessions[index] = re.sub(r'[\r\n\t]+', '', session)

        return sessions
예제 #12
0
    def get_session_list(self):
        sessions = url_xpath(
            'https://apps.legislature.ky.gov/record/pastses.html',
            '//td/div/a/text()')

        for index, session in enumerate(sessions):
            # Remove escaped whitespace characters.
            sessions[index] = re.sub(r'\s\s+', ' ', session)
            sessions[index] = sessions[index].strip()

        return sessions
예제 #13
0
 def get_session_list(self):
     # Special sessions are available in the archive, but not in current session.
     # Solution is to scrape special session as part of regular session
     return [
         x for x in
         url_xpath(
             'http://www.capitol.tn.gov/legislation/archives.html',
             '//h2[text()="Bills and Resolutions"]/following-sibling::ul/li/text()'
         )
         if x.strip()
     ]
예제 #14
0
 def _add_agenda_real(self, url, event):
     trs = url_xpath(url, "//tr")
     for tr in trs:
         tds = tr.xpath("./*")
         billinf = tds[0].attrib['id']  # TN uses bill_ids as the id
         descr = tr.xpath("./td//p")[-1].text_content()
         agenda_item = event.add_agenda_item(descr)
         agenda_item.add_bill(billinf, id=billinf)
     event.add_source(url)
     event.add_document("Agenda", url)
     return event
예제 #15
0
    def get_session_list(self):
        sessions = []
        regex = r"2[0-9][0-9][0-9]\ .*\ Session"

        tags = url_xpath(
            'http://www.leg.state.co.us/clics/cslFrontPages.nsf/PrevSessionInfo?OpenForm',
            "//font/text()"
        )
        for tag in tags:
            sess = re.findall(regex, tag)
            for session in sess:
                sessions.append(session)

        return sessions
예제 #16
0
def get_default_headers(page):
    headers = {}
    for el in url_xpath(page, "//*[@name]"):
        name = el.attrib['name']
        value = ""
        try:
            value = el.attrib['value']
        except KeyError:
            value = el.text

        if value:
            value = value.strip()

        headers[name] = value or ""
    headers['__EVENTTARGET'] = ""
    headers['__EVENTARGUMENT'] = ""
    headers['__LASTFOCUS'] = ""
    return headers
예제 #17
0
 def get_session_list(self):
     return url_xpath(
         'http://www.legis.state.ak.us/basis/start.asp',
         "//div[@id='rightnav']//a[contains(@href, 'start.asp?session=')]//nobr/text()"
     )
예제 #18
0
 def get_session_list(self):
     return url_xpath(
         'http://www.legis.state.pa.us/cfdocs/legis/home/bills/',
         '//select[@id="billSessions"]/option/text()')
예제 #19
0
 def get_session_list(self):
     return url_xpath(
         'https://www.revisor.mn.gov/revisor/pages/'
         'search_status/status_search.php?body=House',
         '//select[@name="session"]/option/text()')
예제 #20
0
 def get_session_list(self):
     sessions = url_xpath(
         "http://www.mainelegislature.org/LawMakerWeb/advancedsearch.asp",
         '//select[@name="LegSession"]/option/text()',
     )
     return sessions
예제 #21
0
 def get_session_list(self):
     return url_xpath('https://www.revisor.mn.gov/revisor/pages/'
                      'search_status/status_search.php?body=House',
                      '//select[@name="session"]/option/text()')
예제 #22
0
 def get_session_list(self):
     from openstates.utils import url_xpath
     zips = url_xpath('http://gencourt.state.nh.us/downloads/',
                      '//a[contains(@href, "Bill%20Status%20Tables")]/text()')
     return [zip.replace(' Bill Status Tables.zip', '') for zip in zips]
예제 #23
0
 def get_session_list(self):
     url = 'https://legis.delaware.gov/'
     sessions = url_xpath(url, '//select[@id="billSearchGARefiner"]/option/text()')
     sessions = [session.strip() for session in sessions if session.strip()]
     return sessions
예제 #24
0
 def get_session_list(self):
     return url_xpath(
         "https://www.house.mo.gov/billcentral.aspx?year=2019&code=S1&q=&id=",
         '//select[@id="SearchSession"]/option/text()',
     )
예제 #25
0
 def get_session_list(self):
     return url_xpath(
         "https://www.revisor.mn.gov/bills/"
         "status_search.php?body=House",
         '//select[@name="session"]/option/text()',
     )
예제 #26
0
 def get_session_list(self):
     return url_xpath("http://billstatus.ls.state.ms.us/sessions.htm", "//a/text()")
예제 #27
0
 def get_session_list(self):
     url = 'https://legis.delaware.gov/'
     sessions = url_xpath(
         url, '//select[@id="billSearchGARefiner"]/option/text()')
     sessions = [session.strip() for session in sessions if session.strip()]
     return sessions
예제 #28
0
 def get_session_list(self):
     return url_xpath(
         "https://nebraskalegislature.gov/bills/",
         "//select[@name='Legislature']/option/text()",
     )[:-1]
예제 #29
0
 def get_session_list(self):
     sessions = url_xpath(
         "http://docs.legis.wisconsin.gov/search",
         "//select[@name='sessionNumber']/option/text()",
     )
     return [session.strip(" -") for session in sessions]
예제 #30
0
 def get_session_list(self):
     return url_xpath(
         'http://www.legis.la.gov/Legis/SessionInfo/SessionInfo.aspx',
         '//table[@id="ctl00_ctl00_PageBody_DataListSessions"]//a[contains'
         '(text(), "Session")]/text()')
예제 #31
0
 def get_session_list(self):
     return url_xpath('http://nebraskalegislature.gov/bills/',
                      "//select[@name='Legislature']/option/text()")[:-1]
예제 #32
0
 def get_session_list(self):
     from openstates.utils import url_xpath
     # this URL should work even for future sessions
     return url_xpath('http://www.oslpr.org/legislatura/tl2013/buscar_2013.asp',
                      '//select[@name="URL"]/option/text()')
예제 #33
0
 def get_session_list(self):
     return url_xpath('http://flsenate.gov', '//option/text()')
예제 #34
0
 def get_session_list(self):
     return [
         s.strip() for s in url_xpath(
             'http://www.legislature.mi.gov/mileg.aspx?page=LegBasicSearch',
             '//option/text()') if s.strip()
     ]
예제 #35
0
 def get_session_list(self):
     from openstates.utils import url_xpath
     # this URL should work even for future sessions
     return url_xpath('http://www.oslpr.org/legislatura/tl2013/buscar_2013.asp',
                      '//select[@name="URL"]/option/text()')
예제 #36
0
 def get_session_list(self):
     return url_xpath("http://ilga.gov/PreviousGA.asp", "//option/text()")
예제 #37
0
 def get_vote_dates(self, page, session):
     dates = url_xpath(page, "//select[@name='votedate']")[0].xpath("./*")
     return [a.text for a in dates if a.text.endswith(session[-2:])]
예제 #38
0
 def get_session_list(self):
     from openstates.utils import url_xpath
     zips = url_xpath(
         'http://gencourt.state.nh.us/downloads/',
         '//a[contains(@href, "Bill%20Status%20Tables")]/text()')
     return [zip.replace(' Bill Status Tables.zip', '') for zip in zips]
예제 #39
0
 def get_session_list(self):
     from openstates.utils import url_xpath
     return url_xpath(
         'http://www.legis.state.wv.us/Bill_Status/Bill_Status.cfm',
         '//select[@name="year"]/option/text()')
예제 #40
0
 def get_session_list(self):
     return url_xpath('http://www.njleg.state.nj.us/',
                      '//select[@name="DBNAME"]/option/text()')
예제 #41
0
 def get_session_list(self):
     url = url_xpath(
         'http://www.kslegislature.org/li',
         '//div[@id="nav"]//a[contains(text(), "Senate Bills")]/@href',
     )[0]
     return [url.split('/')[2]]
예제 #42
0
 def get_session_list(self):
     sessions = url_xpath('http://le.utah.gov/Documents/bills.htm',
                          '//p/a[contains(@href, "session")]/text()')
     return [re.sub(r'\s+', ' ', session.strip()) for session in sessions]
예제 #43
0
 def get_session_list(self):
     return url_xpath('http://www.nmlegis.gov/',
                      '//select[@name="ctl00$MainContent$ddlSessions"]'
                      '/option/text()')
예제 #44
0
 def get_session_list(self):
     sessions = url_xpath(
         "http://le.utah.gov/Documents/bills.htm",
         '//ul[contains(@class,"bills-alternate")]/li/a[contains(@href, "BillList")]/text()',
     )
     return [re.sub(r"\s+", " ", session.strip()) for session in sessions]
예제 #45
0
 def get_session_list(self):
     sessions = url_xpath(
             'http://le.utah.gov/Documents/bills.htm',
             '//p/a[contains(@href, "session")]/text()'
             )
     return [re.sub(r'\s+', ' ', session.strip()) for session in sessions]
예제 #46
0
 def get_session_list(self):
     return url_xpath(
         'http://status.rilin.state.ri.us/bill_history.aspx?mode=previous',
         '//select[@name="ctl00$rilinContent$cbYear"]/option/text()')
예제 #47
0
 def get_session_list(self):
     return url_xpath('http://billstatus.ls.state.ms.us/sessions.htm',
                      '//a/text()')
예제 #48
0
 def get_session_list(self):
     return url_xpath(
         'http://legisweb.state.wy.us/LSOWeb/SessionArchives.aspx',
         '//div[@id="divLegContent"]/a/p/text()',
     )
예제 #49
0
 def get_session_list(self):
     return url_xpath(
         'http://www.senate.mo.gov/pastsessions.htm',
         '//div[@id="list"]/li/a/text()',
     )
예제 #50
0
 def get_session_list(self):
     return url_xpath(
         'http://mgaleg.maryland.gov/webmga/frmLegislation.aspx?pid=legisnpage&tab=subject3',
         '//select[contains(@name, "cboSession")]/option/text()')
예제 #51
0
 def get_session_list(self):
     sessions = url_xpath('https://www.legislature.ohio.gov/legislation/search-legislation',
                          '//div[@class="selectedValues"]/ul/span/li/text()')
     # Archive does not include current session
     return sessions
예제 #52
0
 def get_session_list(self):
     sessions = url_xpath(
         "http://lis.virginia.gov/", "//div[@id='sLink']//select/option/text()"
     )
     return [s.strip() for s in sessions if "Session" in s]
예제 #53
0
 def get_session_list(self):
     return url_xpath(
             'http://www.legvi.org/vilegsearch/',
             '//select[@name="ctl00$ContentPlaceHolder$leginum"]/option/text()')
예제 #54
0
 def get_session_list(self):
     return url_xpath(
         'http://www.legislature.mi.gov/mileg.aspx?'
         'page=LegBasicSearch', '//option/text()')
예제 #55
0
 def get_session_list(self):
     links = url_xpath('http://www.arkleg.state.ar.us/assembly/2013/2013R/Pages'
                       '/Previous%20Legislatures.aspx', '//a')
     sessions = [a.text_content() for a in links if 'Session' in a.attrib.get(
                 'title', '')]
     return sessions
예제 #56
0
 def get_session_list(self):
     return url_xpath('http://flsenate.gov', '//option/text()')
예제 #57
0
 def get_session_list(self):
     return url_xpath('https://capitol.texas.gov/',
                      '//select[@name="cboLegSess"]/option/text()')
예제 #58
0
 def get_session_list(self):
     return url_xpath(
         'http://www.legis.la.gov/Legis/SessionInfo/SessionInfo.aspx',
         '//table[@id="ctl00_ctl00_PageBody_DataListSessions"]//a[contains'
         '(text(), "Session")]/text()')
예제 #59
0
 def get_session_list(self):
     return url_xpath(
         'https://www.revisor.mn.gov/bills/'
         'status_search.php?body=House',
         '//select[@name="session"]/option/text()',
         verify=False)
예제 #60
0
 def get_session_list(self):
     return url_xpath(
         'http://www.senate.mo.gov/pastsessions.htm',
         '//div[@id="list"]/li/a/text()',
     )