I am trying to fix a validation to get the correct values, however. my check function it works as indeed, but it returns [] if found ts/sci or any other word from the forbidden array or ['owasp','python'] if matched with the given array keywords from array , but at the moment to integrate with the main code it doesn't work as it should be
working code
string = "opportunity: this opportunity would suit a budding hacker who is seeking a first step into a commercial role or a tester with 1-3 years of experience. this is a great opportunity to utilise your experience in penetration testing, vulnerability assessments and delivering outcomes while also expanding your knowledge and skillset. benefits: perform red team engagements excellent training & development budget attendance at local and international conferences responsibilities include: working with a diverse range of customers identify and solve security problems perform penetration testing and vulnerability assessments maintain and improve penetration testing and methodologies delivery of technical reports and documentation ideally you will have: ideally current security clearance or minimum australian citizenship certifications such as oscp, sans, crest highly regarded fluent with linux command line and windows powershell experience performing assessments on client networks ability to clearly communicate vulnerability details and risks for a confidential discussion about this opportunity or to discuss other opportunities within it security & risk please contact specialist infosec recruiter marcus lavalle-smith on 0437 073 097 or email msmith@humanisedgroup.com. australian citizens only – ideally already with a security clearance. want to know more about me? connect with me on linkedin – https://www.linkedin.com/in/marcuslavalle-smith/"
string_2 = "your new company this melbourne based consultancy boasts a unique depth and breadth of capabilities across cyber security, application security, data & analytics, cloud and digital transformations. they continue to deliver rich insight, innovative strategies and solutions that help their clients reach their potential. about the opportunity this is an outstanding opportunity to utilise your experience in penetration testing and vulnerability assessments. you will use your skills to prepare high quality reports detailing security issues, making recommendations and identifying solutions. the types of testing can include vulnerability assessment, penetration testing and application security assessment. what you’ll need to succeed passion, drive and enthusiasm! demonstrated experience performing internal and external penetration testing, web application penetration testing and mobile application penetration testing industry certifications such as sans, oscp, crest crt/cct or osce strong knowledge of common vulnerabilities such as owasp top 10 and sans top 25 scripting experience - javascript, objective c and python a very strong technical background and a passion for security the ability to think outside the box what you'll get in return our client is looking for an individual that is seeking longevity in their next role and in return offers the chance to join an equal opportunity employer that is passionate about diversity. also on offer is ongoing personal and professional development, providing you with the right tools and support to thrive. what you need to do now if you’re interested in this role, click ‘apply now’ or for more information and a confidential discussion on this role or any others within it security contact jess moiler on jessm@halcyonknights.com.au"
forbidden = ['clearance','TS/SCI','4+ years','5+ years','6+ years','7+ years','8+ years','9+ years','10+ years','11+ years','12+ years']
skills = ['owasp','sans','oscp']
def check(string, forbidden, skills):
match = []
if any(s_prefix in string for s_prefix in forbidden): return match
match = [skill for skill in skills if skill in string]
return match
skill_match = check(string,forbidden,skills)
print(skill_match)
if-statements from the main code
for page in html:
prefix = ['30', 'monaten', 'meses', 'luni', 'mois', 'month', 'months', 'maanden', 'mesi', 'mies.', 'm\u00e5nader', '\u043c\u0435\u0441\u044f\u0446\u0435\u0432']
forbidden = ['clearance','TS/SCI','dod','bpss','ctc','ebs','sc','dv','4+ years','5+ years','6+ years','7+ years','8+ years','9+ years','10+ years','11+ years','12+ years']
job = extract_job_title(page).casefold()
date_str = extract_date(page)
try:
job_description = extract_fulltext(page['data-jk'])
except:
pass
s_date = date_str.replace('+', '')
skill_match = [s_prefix for s_prefix in forbidden if s_prefix in job_description]
month_match = [match_prefix for match_prefix in prefix if match_prefix in s_date]
job_title_match = [job_prefix for job_prefix in self.job_title if job_prefix in job]
if len(month_match) > 0:
pass
if "NOT_FOUND" in s_date:
pass
if len(skill_match) > 0 :
pass
if not len(job_title_match) > 0:
pass
else:
self.data_extracted['jobs'].append({
'job_title': job,
'company': extract_company(page),
'city': extract_location(page),
'date': extract_date(page),
'job_description': extract_fulltext(page['data-jk']).casefold(),
'url': [self.urls[country] + extract_link(page)]
})
with open(self.file, 'w') as outfile:
json.dump(self.data_extracted, outfile, indent=4)
I expect the output of gathering data with ts/sci, clearance, and non matched skill array, but I want my output looks like the following example: if contains ts/sci or similar skip it , however I got the check that does it , but at the moment of if statments is not doing the job
Aucun commentaire:
Enregistrer un commentaire