Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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()'
     )
Esempio n. 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
     ]
Esempio n. 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()')
Esempio n. 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
Esempio n. 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
        ])]
Esempio n. 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
Esempio n. 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
Esempio n. 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()
     ]
Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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()"
     )
Esempio n. 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()')
Esempio n. 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()')
Esempio n. 20
0
 def get_session_list(self):
     sessions = url_xpath(
         "http://www.mainelegislature.org/LawMakerWeb/advancedsearch.asp",
         '//select[@name="LegSession"]/option/text()',
     )
     return sessions
Esempio n. 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()')
Esempio n. 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]
Esempio n. 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
Esempio n. 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()',
     )
Esempio n. 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()',
     )
Esempio n. 26
0
 def get_session_list(self):
     return url_xpath("http://billstatus.ls.state.ms.us/sessions.htm", "//a/text()")
Esempio n. 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
Esempio n. 28
0
 def get_session_list(self):
     return url_xpath(
         "https://nebraskalegislature.gov/bills/",
         "//select[@name='Legislature']/option/text()",
     )[:-1]
Esempio n. 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]
Esempio n. 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()')
Esempio n. 31
0
 def get_session_list(self):
     return url_xpath('http://nebraskalegislature.gov/bills/',
                      "//select[@name='Legislature']/option/text()")[:-1]
Esempio n. 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()')
Esempio n. 33
0
 def get_session_list(self):
     return url_xpath('http://flsenate.gov', '//option/text()')
Esempio n. 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()
     ]
Esempio n. 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()')
Esempio n. 36
0
 def get_session_list(self):
     return url_xpath("http://ilga.gov/PreviousGA.asp", "//option/text()")
Esempio n. 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:])]
Esempio n. 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]
Esempio n. 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()')
Esempio n. 40
0
 def get_session_list(self):
     return url_xpath('http://www.njleg.state.nj.us/',
                      '//select[@name="DBNAME"]/option/text()')
Esempio n. 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]]
Esempio n. 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]
Esempio n. 43
0
 def get_session_list(self):
     return url_xpath('http://www.nmlegis.gov/',
                      '//select[@name="ctl00$MainContent$ddlSessions"]'
                      '/option/text()')
Esempio n. 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]
Esempio n. 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]
Esempio n. 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()')
Esempio n. 47
0
 def get_session_list(self):
     return url_xpath('http://billstatus.ls.state.ms.us/sessions.htm',
                      '//a/text()')
Esempio n. 48
0
 def get_session_list(self):
     return url_xpath(
         'http://legisweb.state.wy.us/LSOWeb/SessionArchives.aspx',
         '//div[@id="divLegContent"]/a/p/text()',
     )
Esempio n. 49
0
 def get_session_list(self):
     return url_xpath(
         'http://www.senate.mo.gov/pastsessions.htm',
         '//div[@id="list"]/li/a/text()',
     )
Esempio n. 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()')
Esempio n. 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
Esempio n. 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]
Esempio n. 53
0
 def get_session_list(self):
     return url_xpath(
             'http://www.legvi.org/vilegsearch/',
             '//select[@name="ctl00$ContentPlaceHolder$leginum"]/option/text()')
Esempio n. 54
0
 def get_session_list(self):
     return url_xpath(
         'http://www.legislature.mi.gov/mileg.aspx?'
         'page=LegBasicSearch', '//option/text()')
Esempio n. 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
Esempio n. 56
0
 def get_session_list(self):
     return url_xpath('http://flsenate.gov', '//option/text()')
Esempio n. 57
0
 def get_session_list(self):
     return url_xpath('https://capitol.texas.gov/',
                      '//select[@name="cboLegSess"]/option/text()')
Esempio n. 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()')
Esempio n. 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)
Esempio n. 60
0
 def get_session_list(self):
     return url_xpath(
         'http://www.senate.mo.gov/pastsessions.htm',
         '//div[@id="list"]/li/a/text()',
     )