当前位置: 首页>>代码示例>>Python>>正文


Python LegistarScraper.councilMembers方法代码示例

本文整理汇总了Python中legistar.scraper.LegistarScraper.councilMembers方法的典型用法代码示例。如果您正苦于以下问题:Python LegistarScraper.councilMembers方法的具体用法?Python LegistarScraper.councilMembers怎么用?Python LegistarScraper.councilMembers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在legistar.scraper.LegistarScraper的用法示例。


在下文中一共展示了LegistarScraper.councilMembers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: supports_fetching_council_members

# 需要导入模块: from legistar.scraper import LegistarScraper [as 别名]
# 或者: from legistar.scraper.LegistarScraper import councilMembers [as 别名]
def supports_fetching_council_members():
    config = Config(hostname="phila.legistar.com", fulltext=True).defaults(DEFAULT_CONFIG)
    scraper = LegistarScraper(config)
    members = scraper.councilMembers()
    try:
        members.next()
    except StopIteration:
        fail("no council members found")
开发者ID:randikp23,项目名称:legistar-scrape,代码行数:10,代码来源:test_legistar_scraper.py

示例2: paging_through_council_members

# 需要导入模块: from legistar.scraper import LegistarScraper [as 别名]
# 或者: from legistar.scraper.LegistarScraper import councilMembers [as 别名]
def paging_through_council_members():
    config = Config(hostname="a2gov.legistar.com", fulltext=False).defaults(DEFAULT_CONFIG)
    scraper = LegistarScraper(config)
    members = list(scraper.councilMembers(follow_links=False))
    assert_greater(len(members), 100)
开发者ID:randikp23,项目名称:legistar-scrape,代码行数:7,代码来源:test_legistar_scraper.py

示例3: Config

# 需要导入模块: from legistar.scraper import LegistarScraper [as 别名]
# 或者: from legistar.scraper.LegistarScraper import councilMembers [as 别名]
  writer.writerow(csv_headers)
    
  for scraper_target in settings.SCRAPER_TARGETS: 

    print "Municipality:", scraper_target['municipality']
    print "Endpoint:", scraper_target['endpoint']

    config = Config(
      hostname = scraper_target['endpoint'],
      fulltext=True,
    ).defaults(DEFAULT_CONFIG)
    scraper = LegistarScraper(config)

    # get all agenda items
    members_list = scraper.councilMembers(follow_links=False)

    try:
      for member in members_list:
        member['Municipality'] = scraper_target['municipality']
        # member['Created Date'] = datetime.datetime.utcnow()

        row = []
        for col in csv_headers:
          extracted_val = ''
          if col in member.keys():
            if type(member[col]) == dict:
              extracted_val = member[col]['label']
            else:
              extracted_val = member[col]
开发者ID:datamade,项目名称:legistar-people,代码行数:31,代码来源:import.py


注:本文中的legistar.scraper.LegistarScraper.councilMembers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。