Следующий вопрос из этого:
Используя LXML с Html, Requests и ETree, он дает ссылки, но не позволяет мне искать ссылки для конкретного текста
Я хотел бы знать, какие у меня есть наилучшие варианты, и каковы наилучшие методы сбора и обработки этих данных.
В этом есть дополнительные части, которые я хотел бы иметь, а именно: Местоположение, Дата, и для будущих ролей потенциальный атрибут, такой как Зарплата, и я хотел бы также взять их, но они имеют те же теги, что и я. можно увидеть, что это тег STRONG, но все они используют его, но все они также находятся внутри одного тега P, например:
Таким образом, я мог бы технически выполнить поиск Местоположения, а затем каким-то образом получить текст, оставленный после этого идентификатора (Местоположение, Дата открытия, Город, Штат, Номер заявки). Честно говоря, я хотел бы иметь все это, но я не знаю, как удалить то, что я бы назвал «Вложенным тегом», или выполнить первоначальную фильтрацию на основе этого, а затем дополнительную фильтрацию на основе содержащего текста, а затем получить СЛЕДУЮЩИЙ текст. Я думал что-то вроде этого:
requisition_num = job_soup.find('div',{'class':'job-details'}, {'p':'strong'}).text
Конец примера
<p>
<strong>Location:</strong>
Stockholm
</p>
Конец примера
Базовый код:
while True:
response = requests.get(url)
data = response.text
soup = BeautifulSoup(data, 'html.parser')
BASE_URL = 'https://ea.gr8people.com/'
links = soup.find_all('a')
links = [a for a in links if a.attrs.get('href') and 'opportunityid' in a.attrs.get('href')]
urls = ['{}{}'.format(BASE_URL, a.attrs.get('href')) for a in links if
a.attrs.get('href') and 'opportunityid' in a.attrs.get('href')]
print('-- urls --')
for idx, url in enumerate(urls):
print('{}) {}'.format(idx, url))
job_response = requests.get(url)
job_data = job_response.text
job_soup = BeautifulSoup(job_data, 'html.parser')
# df = pd.read_html(url)[2] # Choose [0], [1], [2], or [3].
# print(df)
job_description = job_soup.find('div',{'class':'job-details'})
title = job_soup.find('h1',{'class':'job-title'}).text
#location_tag = job_soup.find('span',{'class':'result-hood'})
location = "N/A" # location_tag.text[2:-1] if location_tag else "N/A"
date = "N/A" # job_soup.find('time',{'class':'result-date'}).text
link = url
print('Job Title:', title, '\nJob Description:', job_description, '\nLocation', location, '\nDate:', date, '\nLink:', link, '\n--------------------')
print("Testing if Job Data is Populated")
print("============================================================================")
# print(job_data)
Выход:
Job Title: AI Scientist
Job Description: <div class="job-details">
<p>
<strong>Requisition Number:</strong>
150468
</p>
<p>
<strong>Position Title:</strong>
Sr Data Scientist
</p>
<p>
<strong>External Description:</strong>
<p><strong><span style="font-size:12pt">We are EA</span></strong></p>
<p><span style="font-size:12pt">And we make games – how cool is that? In fact, we entertain millions of people across the globe with the most amazing and immersive interactive software in the industry. But making games is hard work. That’s why we employ the most creative, passionate people in the industry.</span></p>
<p><strong><span style="font-size:12pt">The Challenge Ahead</span></strong></p>
<p><span style="font-size:12pt">The EA Digital Platform Data & AI Group is responsible for providing unified Artificial Intelligence (AI) resources across all franchises within Electronic Arts. Our group develops state-of-the-art machine learning, AI, and data-driven solutions to game team problems, as well as common AI infrastructure for use in every facet of the company. From data modeling to agent building, we utilize a modern, cloud-based tech stack with best-in-class tools to provide solutions and platforms empowering the future state of game development and player experience. We’re currently looking for an AI Scientist to join our team!</span></p>
<p><strong><span style="font-size:12pt">What an AI Scientist does at EA</span></strong></p>
<ul><li><span style="font-size:12pt">Develop state-of-the-art algorithms and extract key insights from EA’s rich store of data to empower intelligent agents within the EA ecosystem</span></li><li><span style="font-size:12pt">Create scalable solutions for problems in the gaming domain</span></li><li><span style="font-size:12pt">Design, develop and evaluate highly innovative AI applications for content creation, NPC behavior, game balance evaluation, and recommendations</span></li><li><span style="font-size:12pt">Work closely with the core development teams to deploy AI applications seamlessly as part of production systems</span></li><li><span style="font-size:12pt">Establish scalable, efficient, automated processes for enterprise-level management of AI applications</span></li><li><span style="font-size:12pt">Research and implement novel AI approaches for new business problems.</span></li></ul>
<p><strong><span style="font-size:12pt"> </span></strong></p>
<p><strong><span style="font-size:12pt">The next great EA AI Scientist should have</span></strong></p>
<ul><li><span style="font-size:12pt">Masters or Ph.D. in Computer Science, or related fields (focus in AI or ML a plus)</span></li><li><span style="font-size:12pt">Track record of having developed novel AI algorithms,
and major journal and conference publications</span></li><li><span style="font-size:12pt">Strong problem-solving ability</span></li><li><span style="font-size:12pt">Strong programming skills (object-oriented and functional paradigms)</span></li><li><span style="font-size:12pt">Experience with large-scale data and distributed systems – Experience with Apache Hadoop, Spark, and Tensorflow a plus</span></li><li><span style="font-size:12pt">Experience with SQL and MPP databases</span></li><li><span style="font-size:12pt">Excellent written and verbal communication skills</span></li></ul>
<p><strong><span style="font-size:12pt"> </span></strong></p>
<p><strong><span style="font-size:12pt">What’s in it for you? Glad you asked!</span></strong></p>
<p><span style="font-size:12pt">We love to brag about our great perks like comprehensive health and benefits packages, tuition reimbursement, and 401k with company match and, of course, free video games. And since we realize it takes world-class people to make world-class games, we offer competitive compensation packages and a culture that thrives on creativity and individuality. At EA, we live the “work hard/play hard” credo every
day.</span></p>
<p><span style="font-size:12pt"> </span></p>
<p><span style="font-size:12pt"> </span></p>
</p>
<p>
<strong>City:</strong>
</p>
<p>
<strong>State:</strong>
</p>
<p>
<strong>Community / Marketing Title:</strong>
AI Scientist
</p>
<p>
<strong>Company Profile:</strong>
<p>Electronic Arts Inc. is a leading global interactive entertainment software company. EA delivers games, content and online services for Internet-connected consoles, personal computers, mobile phones and tablets.</p>
</p>
<p>
<strong>EEOText:</strong>
EA is an equal opportunity employer. All employment decisions are made without regard to race, color, national origin, ancestry, sex, gender, gender identity or expression, sexual orientation, age, genetic information, religion, disability, medical condition, pregnancy, marital status, family status, veteran status, or any other characteristic protected by law. We will
also consider for employment qualified applicants with criminal records in accordance with applicable law. EA also makes workplace accommodations for qualified individuals with disabilities as required by applicable law.
</p>
<p>
<strong>Date Opened:</strong>
2018-06-05 18:24:44.017
</p>
<p>
<strong>EEO Employer Verbiage:</strong>
<p>EA is an equal opportunity employer. All employment decisions are made without regard to race, color, national origin, ancestry, sex, gender, gender identity or expression, sexual orientation, age, genetic information, religion, disability, medical condition, pregnancy, marital status, family status or veteran status. We will also consider for employment qualified applicants with criminal records in accordance with applicable law.</p>
</p>
<p>
<strong>Location:</strong>
Redwood City
</p>
<p>
<strong>Location_formattedLocationLong:</strong>
Redwood City, California US
</p>
</div>
Location N/A
Date: N/A
Link: https://ea.gr8people.com/index.gp?method=cappportal.showJob&layoutid=2092&inp1541=&inp1375=150468&opportunityid=150468
--------------------
Testing if Job Data is Populated
============================================================================
Обновление № 1:
Поэтому я попробовал следующее:
requisition_num = job_soup.find('div',{'class':'job-details'}, {'p':'strong'}).text
И это было очень близко к тому, что я хотел сделать со всеми ними. Одна вещь, которую я заметил, - огромный пробел в общем пространстве между заголовком позиции элемента и «Contigent». Хотя я не уверен, как исправить это.
У кого-нибудь есть идеи?
Requisition:
Requisition Number:
154484
Position Title:
Contingent
External Description:
Assistant Producer
Role Overview:
This design position is responsible for gameplay content. The Producer will work with their team to create innovative and engaging ideas, designs and prototypes while maintaining EA's high standard of quality.
Key Responsibilities:
Deliver on the game vision as set by the Creative Director and Product Owner.Maintain all design aspects of live services through the entire project life cycle.Balance game with consideration to fun gameplay, player acquisition, and engagement.Retain original IP’s core brand values and game experience within the service at all times.Inspire live service team and players through innovative and new in-game items and elements.Provide and receive critique in a constructive manner with suggestions and solutions for improvement.Remain current on industry trends including new game genres, new game design methods, and emerging platforms
Required Skills and Experience:
Bachelor’s Degree or equivalent considered but not required.Experience in a live service environment2+ year’s industry experience specifically in game design or quality assurance.Proven ability to conceptualize, create and implement game concepts using various tools and technology.Broad knowledge of, and passion for, the casual, mobile or sports game genres.Database Entry Experience, specifically with SQL.Excellent creative, analytical and organizational skills with proven ability to write, communicate and maintain detailed design documentation throughout the project life cycle.Demonstrative proof of an open-minded, progressive thinker who is flexible, energetic and driven with the ability to overcome obstacles and challenges with working solutions.Thorough understanding of gameplay theories and interface design abilitySuperior communication skills with experience presenting visions both verbally and on paper.Results orientated with strong documentation skillsKnowledge of Football is a plus!
EA is an equal opportunity employer. All qualified applicants will receive consideration for employment without regard to race, color, religion, sex, national origin, ancestry, pregnancy, age, sexual orientation, marital status, protected veteran status, medical condition or disability, or any other characteristic protected by law.
For more information about EA SPORTS, including news, video, blogs, forums, and game apps, please visit www.easports.com.
City:
State:
Community / Marketing Title:
Assistant Producer (Contract)
Company Profile:
Electronic Arts Inc. is a leading global interactive entertainment software company. EA delivers games, content and online services for Internet-connected consoles, personal computers, mobile phones and tablets.
EEOText:
EA is an equal opportunity employer. All employment decisions are made without regard to race, color, national origin, ancestry, sex, gender, gender identity or expression, sexual orientation, age, genetic information, religion, disability, medical condition, pregnancy, marital status, family status, veteran status, or any other characteristic protected by law. We will
also consider for employment qualified applicants with criminal records in accordance with applicable law. EA also makes workplace accommodations for qualified individuals with disabilities as required by applicable law.
Date Opened:
2019-01-29 17:52:21.913
EEO Employer Verbiage:
EA is an equal opportunity employer. All employment decisions are made without regard to race, color, national origin, ancestry, sex, gender, gender identity or expression, sexual orientation, age, genetic information, religion, disability, medical condition, pregnancy, marital status, family status or veteran status. We will also consider for employment qualified applicants with criminal records in accordance with applicable law.
Location:
Orlando
Location_formattedLocationLong:
Orlando, Florida US