簡體   English   中英

將LXML與Html,Requests和ETree一起使用,除了文本之外,它還提供了所有HTML標簽,我不知道為什么

[英]Using LXML with Html, Requests, and ETree, it gives all HTML Tags in addition to text, and I dont know why

后續問題:

將LXML與Html,Requests和ETree一起使用,它可以提供鏈接,但不會讓我搜索特定文本的鏈接

我想知道我有什么最佳選擇,以及獲取和處理數據的最佳實踐是什么。

我還希望擁有其他內容,例如位置,日期,以及對於未來角色的潛在屬性(例如薪水),我也想抓住這些內容,但是從我所看到的來看,它們具有相同的標簽,這是STRONG標簽,但他們都使用它,但是它們也都在同一個P標簽中,例如:

因此,我可以從技術上搜索“位置”,然后以某種方式獲取該標識符詞(“位置”,“打開日期”,“城市”,“州”,“請購單”)之后剩下的文本。 老實說,我想擁有這一切,但是我不知道如何刪除我要描述的嵌套標簽,或者基於它進行初始過濾,然后基於包含文本進行其他過濾,然后獲得NEXT文本。 我在想這樣的事情:

requisition_num = job_soup.find('div',{'class':'job-details'}, {'p':'strong'}).text

示例結束

   <p>

                                <strong>Location&#x3a;</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 &amp; 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

而且它非常接近我要對所有人進行的操作。 我注意到的一件事是,項目位置標題和“連續”之間的通用空間之間存在巨大差距。 我不確定該如何補救。

有人有什么想法嗎?

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

您可以做幾件事:

選項1:存儲所需的每個項目,然后按照所需的方式打印出來。

即:

....
job_description = job_soup.find('div',{'class':'job-details'})

title = job_soup.find('h1',{'class':'job-title'}).text
requisition_num = job_description.find('strong', text = 'Requisition Number:').next_sibling.strip()
pos_title = job_description.find('strong', text = 'Position Title:').next_sibling.strip()
desc = job_description.find('strong', text = 'External Description:').next_sibling.strip()

city = job_description.find('strong', text = 'City:').next_sibling.strip()
state = job_description.find('strong', text = 'State:').next_sibling.strip()
community = job_description.find('strong', text = 'Community / Marketing Title:').next_sibling.strip()
company_profile = job_description.find('strong', text = 'Company Profile:').next_sibling.strip()
....

或更好的選擇2是那些差距是制表符。 您可以卸下水龍頭並更換它們。

requisition_num = job_soup.find('div',{'class':'job-details'}, {'p':'strong'}).text.replace('\t', '')

輸出:

print(requisition_num)


Requisition Number:
154773


Position Title:
Audio Artist II


External Description:
ENGLISH FOLLOWS
(Contrat temporaire pour 12 mois)
Audioworks est une équipe primée responsable de la création du contenu audio pour les titres des STUDIOS EA. Audioworks unit nos talents créatifs et notre expertise technique pour proposer un contenu audio à l’avant-garde de l’industrie en alliant partenariat, professionnalisme, expertise, innovation et qualité irréprochable. De nombreux projets captivants sont en cours et nous produisons du contenu audio révolutionnaire pour les produits intrajeu de multiples studios.  
L’équipe Audioworks est à la recherche d’un artiste audio à temps plein pour un mandat d’un an au studio Motive de Montréal afin de contribuer à l’aspect créatif des nouvelles PI. Motive est un nouveau studio créatif, incubateur de projets extraordinaires visant à redéfinir les jeux d’action et à proposer aux adeptes des jeux novateurs de qualité supérieure.
Rôle 
Le candidat sera appelé à collaborer avec des partenaires d’équipe de jeu de base et l’équipe Audio pour concevoir une expérience sonore de bout en bout destinée à de nouveaux projets ambitieux. À titre de membre de l’équipe Audioworks, le candidat contribuera à livrer une expérience de jeu de haute qualité et immersive tout en contribuant à la communauté audio dans son ensemble.
Le candidat idéal doit démontrer une passion pour les jeux vidéo et la conception sonore, ainsi qu’une volonté extraordinaire de créer une expérience sonore de renommée mondiale.
Responsabilités
Créer une trame audio de qualité pour les jeux vidéoSuivre les jalons et les tâches et livrer le contenu selon l’échéanceCréer et dépanner les systèmes audio intégrés au moteurAssurer une mise en œuvre audio conforme à la direction audioConcevoir l’aspect sonore des éléments sources ou du montage de voix, nomenclature et organisation des fichiersFournir occasionnellement du soutien à la création de musique et de voix hors-champ
Exigences
Minimum de deux ans d’expérience en audio ou en postproduction de jeuxCapacité de travailler de manière autonome et au sein de l’équipe Audio, avec un esprit positif et une ouverture à la rétroaction/à l’itérationMaîtrise des outils, de la technologie et des pipelines de création audio (y compris Wwise ou Fmod, MaxMsp/PureData)Expérience de travail dans un moteur de jeu principal (Unity, Unreal)Solides connaissances d’au moins un poste de travail audionumérique principal (Reaper, Protools, Cubase, Live...)Expérience avec les techniques d’enregistrement et le fonctionnement de l’équipement audio numérique standardSolides compétences de communication et de résolution de problèmesFortes sensibilités artistiques, créatives et techniquesExpérience en mixage d’éléments multicanaux et en réalité virtuelle un atoutConnaissance de JIRA et de Confluence
Qu’avons-nous à vous offrir? Bonne question! 
Nous adorons vanter les avantages que nous offrons comme des régimes d’assurance-maladie et d’avantages sociaux complets, le remboursement des frais de cours, un régime d’épargne-retraite avec cotisation équivalente et, bien sûr, plusieurs autres à-côtés. Nous savons que pour créer des jeux de renommée mondiale, il nous faut des talents de classe mondiale. C’est pourquoi nous offrons une rémunération concurrentielle ainsi qu’une culture basée sur la créativité et l’individualité. Chez EA, nous incarnons le modèle « travail-loisir » chaque jour.
Plus sur notre emplacement : http://carreers.ea.com/our-locations/montreal
Les studios Motive vous offrent les moyens et l'occasion. Venez découvrir ce dont vous êtes capable!

***

(12 months temporary contract)
EA’s Audioworks is an award-winning team creating audio content for titles within EA STUDIOS. Audioworks unites our creative talents and technical expertise to drive industry leading audio through partnership, professionalism, expertise, innovation and uncompromising quality. There are many exciting projects underway and we produce progressive audio content for in-game products from multiple studio locations.  
The Audioworks team has a full-time, one-year Audio Artist opportunity at our Motive studio in Montreal, to contribute creatively to our future IPs. Motive is a new creative-driven studio, incubating some amazing projects aimed at redefining action games and bringing the highest quality innovative games to players.
Role 
This role entails working with core game team partners and the Audio team to help craft an end to end audio experience for ambitious new projects. As a member of the Audioworks team you are responsible for helping deliver a high quality and engaging game experience, as well contributing to the larger audio community.
The ideal candidate will have a passion for video games and sound design with an overwhelming drive to create a world class audio experience.
Responsibilities
Creating quality audio for video gamesFollow milestones and tasks, deliver content on time.Create and debug in-engine audio systems.Ensure proper sound implementation in respect with the Audio Direction.Sound design of source elements and/or speech editing, naming and file organization.Can be called to provide support with music and voice over authoring.
Requirements
Minimum of two years game audio and/or post-production experience.Ability to work autonomously as well as part of the Audio team, bringing a positive mindset and open to feedback/iteration.Is proficient in using game audio authoring tools, technology and pipelines. (Including Wwise or Fmod, MaxMsp/PureData)Working experience in a major game engine (Unity, Unreal)Strong knowledge of at least one major DAW (Reaper, Protools, Cubase, Live...).Experienced in recording techniques and standard digital audio equipment operation.Strong communication and problem-solving skills.Strong artistic, creative and technical sensibilities.Multichannel mixing and Virtual Reality audio experience would be an assetKnowledge of JIRA and Confluence
What’s in it for you? Glad you asked! 
We love to brag about our great perks like comprehensive health and benefit packages, tuition reimbursement, RRSP company match and, of course, many other perks! And since we realize it takes world-class people to make world-class games, we offer competitive compensation packages and a culture that thrives off of creativity and individuality. At EA, we live the “work hard/play hard” credo every day.
More about our location: http://careers.ea.com/our-locations/montreal
Motive Studios has the Means and Opportunity. Come see what you can do!


City:


State:


Community / Marketing Title:
Artiste Audio / Audio Artist


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. EA also makes workplace accommodations for qualified individuals with disabilities as required by applicable law.


Date Opened:
2019-02-26 22:14:48.91


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:
Montreal


Location_formattedLocationLong:
Montreal, Quebec  CA

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM