Py学习  »  Python

Python BS4-在两个不同标记之间连接多个html元素以进行批处理url

Pal S • 6 年前 • 1986 次点击  

继续我先前的问题 Python BS4 - Concatenating multiple html elements between two different tags

我想扩展多个url的解决方案。 考虑两个url link1 | link2

html源代码如下所示

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

我的要求:

  • 唯一的静态文本似乎是 <p><strong>COMPANY DESCRIPTION</strong> 在顶部& <p><strong>WHAT YOU GET FROM US </strong></p> 在底部。
  • 另请注意,“公司说明”部分有2段 <p> 在里面。我也不想第二段以 <p>SAP values the entrepreneurial spirit,
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/55594
文章 [ 1 ]  |  最新文章 6 年前