本文整理匯總了Python中jobcert.parser.Parser.parse方法的典型用法代碼示例。如果您正苦於以下問題:Python Parser.parse方法的具體用法?Python Parser.parse怎麽用?Python Parser.parse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jobcert.parser.Parser
的用法示例。
在下文中一共展示了Parser.parse方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_title
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_title(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-rdfa.html'))
assert parser.job_advert.title == "Software Engineer"
示例2: test_employment_type_missing
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_employment_type_missing(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-rdfa-employment-type-missing.html'))
assert parser.get_result('has-employment-type')['result'] == False
示例3: test_publishing_format
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_publishing_format(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-rdfa.html'))
assert parser.job_advert.publishing_format == "rdfa"
示例4: test_location_missing
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_location_missing(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-jsonld-location-missing.html'))
assert parser.job_advert.address == None
assert parser.get_result('location-clarity')['result'] == 'missing'
示例5: test_employment_type
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_employment_type(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-jsonld.html'))
assert parser.job_advert.employment_type == 'Full-time'
assert parser.get_result('has-employment-type')['result'] == True
示例6: test_location_unclear
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_location_unclear(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-jsonld.html'))
assert parser.job_advert.address == 'Kirkland, WA'
assert parser.get_result('location-clarity')['result'] == 'unclear'
示例7: test_location_clear
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_location_clear(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-jsonld-location-clear.html'))
assert parser.job_advert.address == 'Somerset House, Strand, London WC2R 1LA, London'
assert parser.get_result('location-clarity')['result'] == 'clear'
示例8: test_salary_unclear
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_salary_unclear(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-jsonld-salary-unclear.html'))
assert parser.get_result('salary-clarity')['result'] == 'unclear'
示例9: test_salary_missing
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_salary_missing(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-jsonld-salary-missing.html'))
assert parser.get_result('salary-clarity')['result'] == 'missing'
示例10: test_parser
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_parser(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-microdata.html'))
assert parser.get_result('flesch-reading-ease')['result']
示例11: test_description
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_description(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-jsonld.html'))
assert parser.job_advert.description == "Description: ABC Company Inc. seeks a full-time mid-level software engineer to develop in-house tools."
示例12: test_feminine
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_feminine(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-microdata-gender-coding-feminine.html'))
assert 'feminine' in parser.get_result('gender-coded-language')['result']
示例13: test_neutral
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_neutral(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-microdata-gender-coding-neutral.html'))
assert parser.get_result('gender-coded-language')['result'] == 'neutral'
示例14: test_check_creative_commons_licence_link
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_check_creative_commons_licence_link(self):
parser = Parser()
parser.parse(read_test_case('licence-link.html'))
assert parser.job_advert.creative_commons_licences == [{'name': 'Creative Commons Attribution', 'url': 'http://creativecommons.org/licenses/by-nd/4.0'}]
assert parser.get_result('creative-commons-licence')['result'] == True
示例15: test_salary_clear
# 需要導入模塊: from jobcert.parser import Parser [as 別名]
# 或者: from jobcert.parser.Parser import parse [as 別名]
def test_salary_clear(self):
parser = Parser()
parser.parse(read_test_case('schemaorg-microdata-salary-clear.html'))
assert parser.get_result('salary-clarity')['result'] == 'clear'