BeautifulSoup4-在两个不同标签之间串联多个html元素以进行批处理url [英] BeautifulSoup4 - Concatenating multiple html elements between two different tags for batch processing url

查看:44
本文介绍了BeautifulSoup4-在两个不同标签之间串联多个html元素以进行批处理url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继续我前面的问题 Python BS4-并置两个不同标签之间的多个html元素

我想将解决方案扩展为多个URL.考虑两个网址 link1 | link2

I want to extend the solution for multiple url. Consider two url link1 | link2

html源代码如下所示

The html source code looks like below

<div class="job">

<p><strong>Requisition ID: </strong>223813
<strong>Work Area: </strong>Consulting  and Professional Services
<strong>Expected Travel: </strong>0 - 80%
<strong>Career Status: </strong>Professional
<strong>Employment Type: </strong>Regular Full Time</p>

<p><strong>COMPANY DESCRIPTION</strong>
SAP started in 1972 as a team of five colleagues with a desire to do something new. Together, they changed enterprise software and reinvented how business was done. Today, as a market leader in enterprise application software, we remain true to our roots. That’s why we engineer solutions to fuel innovation, foster equality and spread opportunity for our employees and customers across borders and cultures.</p>

<p>SAP values the entrepreneurial spirit, fostering creativity and building lasting relationships with our employees. We know that a diverse and inclusive workforce keeps us competitive and provides opportunities for all. We believe that together we can transform industries, grow economics, lift up societies and sustain our environment. Because it’s the best-run businesses that make the world run better and improve people’s lives.</p>

.
.
.
.
.
.

<p><strong>WHAT YOU GET FROM US </strong></p>
<p>Success is what you make it. At SAP, we help you make it your own. A career at SAP can open many doors for you. If you’re searching for a company that’s dedicated to your ideas and individual growth, recognizes you for your unique contributions, fills you with a strong sense of purpose, and provides a fun, flexible and inclusive work environment – apply now<em>.</em></p>

我的要求:

  • 获取代码上方标记为点的部分.它是动态内容因此无法对任何节头进行硬编码.请参阅上面提供的2个链接,以了解内容的差异.
  • 唯一的静态文本似乎是顶部&顶部的< p>< strong>公司描述</strong> .< p>< strong>您从美国获得的信息</strong></p> 在底部.
  • 所以我需要所有的html标签&公司说明"和在您从我们那里得到什么"之前
  • 还请注意,公司说明"部分中包含2段< p> .我不希望第二段以< p> SAP重视企业家精神
  • Get the section marked as dots in above the code. It is dynamic content & hence can't hardcode any of the section headers. Refer to the 2 links provided above to see the difference in content.
  • The only static text seems to be <p><strong>COMPANY DESCRIPTION</strong> at the top & <p><strong>WHAT YOU GET FROM US </strong></p> at the bottom.
  • So I need all the html tags & elemnts after "COMPANY DESCRIPTION" & before "WHAT YOU GET FROM US"
  • Also observe that the "COMPANY DESCRIPTION" section has 2 para <p> in it. I don't want the 2nd para either which starts with <p>SAP values the entrepreneurial spirit,

推荐答案

使用css选择器检查文本是否包含"COMPANY Description"和其余代码相同.

Use the css selector to check the text contains "COMPANY DESCRIPTION" and remaining code same.

代码:

import requests
from bs4 import BeautifulSoup
def scrape_url(url, method='bs4'):
    session = requests.session()
    page = session.get(url)
    soup = BeautifulSoup(page.text, 'html.parser')
    return soup

urls=['https://jobs.sap.com/job/Kuala-Lumpur-Business-Processes-Consultant-%28FICO%29-Job-14/541909901/','https://jobs.sap.com/job/Mumbai-Senior-Account-Executive-Job-MH/539212101/']

for url in urls:
    print(url)
    soup = scrape_url(url)
    findtag=soup.select_one('p:contains("COMPANY DESCRIPTION")')
    print(findtag.text)
    findnextptag=findtag.find_next_sibling('p')
    for item in findnextptag.find_next_siblings():

         if 'WHAT YOU GET FROM US' in item.text:
             break
         else:
             print(item.text.strip())

    print("======================================")

输出:

https://jobs.sap.com/job/Kuala-Lumpur-Business-Processes-Consultant-%28FICO%29-Job-14/541909901/
COMPANY DESCRIPTION
SAP started in 1972 as a team of five colleagues with a desire to do something new. Together, they changed enterprise software and reinvented how business was done. Today, as a market leader in enterprise application software, we remain true to our roots. That’s why we engineer solutions to fuel innovation, foster equality and spread opportunity for our employees and customers across borders and cultures.
PURPOSE AND OBJECTIVES

To address requirements in the area of Supply Chain Management Extended Warehouse Management solutions, Build competencies at Solution Delivery Center to deliver solutions especially in areas relating to SAP EWM

EXPECTATIONS AND TASKS

Independently handle large implementation projects with focus on Warehouse Management processes such as inbound, outbound and internal processes. RF Device functions and Barcode support experience is desirable
Able to lead EWM discussions, assessments and detail requirement studies with customers
Leading the team that are assigned to, in functional capacity, adding value to the project and to the final deliverables
Be actively involved in the preparation, conception, realization and Go Live of customer implementation projects
Demonstrate the ability to plan, run, and manage blueprint workshops / meetings with internal and external clients
Responsible for defining the scope of a project / opportunities, estimating efforts and project timelines
Participating in RFP discussions and estimating under guidance from a Bid Manager
Providing a creative source of ideas/solutions to address problems
Delivering billable components that meets a customer’s needs
KEY PERFORMANCE INDICATORS

Customer Feedback/customer satisfaction scores
Productive days/utilization as defined by the organization for projects/assessments/etc.
Knowledge Management and creation of effective reusable components
EXPERIENCE REQUIREMENTS

Minimum of 4+ years industry experience and a minimum of 5 to 6 years of SAP EWM experience
Domain knowledge in Supply Chain Management in the areas of Planning, Manufacturing & warehousing processes is a must
Must have strong ERP implementation experience
Experience in SAP Material Flow Systems (MFS) or any other third party automation tools will be desirable
Experience in EWM technical knowledge will be an added advantage
Knowledge on SAP S/4HANA Public Cloud solution and SAP IOT/Leonardo portfolio will be preferred but not mandatory
Good understanding of S/4HANA Order to Cash and Procure to Pay business processes
Good understanding of SAP ACTIVATE implementation methodology
Use of Solution Manager as a part of implementation life cycle is desirable
Good Communication skill in English.

EDUCATION AND QUALIFICATIONS/SKILLS AND COMPETENCIES

Degree in Engineering or IT
SAP Certification in Extended Warehouse Management (EWM) desirable
Minimum 4 to 5 full life cycle SAP EWM implementations
Strong knowledge in SAP SCM Extended Warehouse Management Solutions and S/4HANA Embedded EWM Solution
Good integration knowledge with other components with SAP S/4HANA (WM, SD, MM, PP) and other SAP or Non-SAP legacy applications
Knowledge of SCOR, APICS certification preferable
Strong client-facing experience and well-developed customer focus
Solid oral and written communication skills, with the demonstrated ability to communicate complex technical topics to management and non-technical audiences
Mobility is must – candidate must be ready to travel to project locations (short term and long term)

======================================
https://jobs.sap.com/job/Mumbai-Senior-Account-Executive-Job-MH/539212101/
COMPANY DESCRIPTION
SAP started in 1972 as a team of five colleagues with a desire to do something new. Together, they changed enterprise software and reinvented how business was done. Today, as a market leader in enterprise application software, we remain true to our roots. That’s why we engineer solutions to fuel innovation, foster equality and spread opportunity for our employees and customers across borders and cultures.
Key Areas of Responsibility and Tasks:

The Account Executive’s primary responsibilities include prospecting, qualifying, selling and closing new business to existing and net new customers. The Account Executive brings a Point of View to Customer engagement; uses all resources to solve customer problems with appropriate SAP products.

1.    Account and Customer Relationship Management, Sales and Software License and Cloud Subscription Revenue.

Annual Revenue - Achieve / exceed quota targets. 
Sales strategies - Develops effective and specific account plans to ensure revenue target delivery and sustainable growth.   Develop relationships in new and existing customers and leverage to drive strategy through organization. 
Trusted advisor - Establishes strong relationships based on knowledge of customer requirements and commitment to value (value of counsel and expertise, the value of solutions, the value of implementation expertise).  Builds a foundation on which to harvest future business opportunities and accurate account information and coaching.
Customer Acumen - Actively understand each customer’s technology footprint, strategic growth plans, technology strategy, and competitive landscape.   Review public information (e.g. new executive appointments, earnings statements, press releases) for the company and its competitors to remain updated on key industry trends and issues impacting the prospect. 
Territory and Account Leadership - Lead designated territory, including accounts, account relationships, prospect profiling, and sales cycles.  Encourage all accounts to become SAP references. 
Business Planning – Develop and deliver comprehensive business plan to address customer and prospects priorities and pain points.   Utilize VE, benchmarking and ROI data to support the customer’s decision process.


2.    Demand Generation, Pipeline and Opportunity Management

Pipeline planning - Follow a disciplined approach to maintaining a rolling pipeline. Keep pipeline current and moving up the pipeline curve.  
Pipeline partnerships – Leverage support organizations including Marketing, Inside sales, Partners and channels to funnel pipeline into the assigned territory.   
Leverage SAP Solutions – Be proficient in and bring all SAP offers to bear on sales pursuits including Industry Solutions, LOB solutions (CRM, SCM, HCM, SRM et. al) and technology solutions (Business Analytics, Mobility, Database and Technology, et. al) 
Advance and close sales opportunities - through the successful execution of the sales strategy and roadmap.
Support all SAP promotions and events in the territory

3.    Sales Excellence

Sell value.   
Maintain White Space analysis and execution of initiatives (up sell and cross sell) on customer base.
Orchestrate resources: deploy appropriate teams to execute winning sales.  Create OneSAP.
Utilize best practice sales models.
Understand SAP’s competition and effectively position solutions against them.
Maintain CRM system with accurate customer and pipeline information.


Experience & Language Requirements

10+ Years of experience in sales of complex business software / IT solutions in Govt/ PSU sector
Proven track record in business application software/ services sales
Experience in the lead role of a team-selling environment. Coordination across multiple internal and external stakeholders and partners. 
Demonstrated success with large transactions and lengthy sales campaigns in a fast-paced, consultative and competitive market.
Business level English: Fluent 
Local language: Fluent, Business Level
Education:

Bachelor equivalent: yes
======================================

这篇关于BeautifulSoup4-在两个不同标签之间串联多个html元素以进行批处理url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆