本文整理汇总了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")
示例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)
示例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]