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


Python Location.setCertificate方法代码示例

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


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

示例1: parse_one_location_page

# 需要导入模块: from location import Location [as 别名]
# 或者: from location.Location import setCertificate [as 别名]
def parse_one_location_page(page, country, city, event_type):
	location_name = parse_location_element(page.xpath(locationNameOnPage)[0])
	location = Location(location_name, country, city, event_type)
	description = ""
	raw_description = page.xpath(locationDescriptionOnPage)
	for p in raw_description:
		description = description + p.replace("\n","")
	location.setDescription(description)
	latitude_raw = page.xpath(latitudeOnPage)
	longitude_raw = page.xpath(longitudeOnPage)
	if(len(latitude_raw) > 0):
		location.setLatitude(float(latitude_raw[0]))
	if(len(longitude_raw) > 0):
		location.setLongitude(float(longitude_raw[0]))
	additional_details = find_details_from_location(location, event_type)
	location.setDuration(additional_details[1])
	location.setRatings(additional_details[2])
	location.setNetRating(additional_details[4])
	location.setHours(additional_details[3])
	location.setTypes(additional_details[5])
	location.setCertificate(additional_details[6])
	return location
开发者ID:smatt989,项目名称:locations,代码行数:24,代码来源:scraper.py


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