Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何使用Scrapy中的response.XPath从多个标记中提取文本数据?_Python_Html_Css_Scrapy - Fatal编程技术网

Python 如何使用Scrapy中的response.XPath从多个标记中提取文本数据?

Python 如何使用Scrapy中的response.XPath从多个标记中提取文本数据?,python,html,css,scrapy,Python,Html,Css,Scrapy,我遇到了一个问题。我想在scrapy中使用XPath从以下HTML中提取文本 <div class="block fix-text job-description"> <p>We’re looking for an experienced <strong>Events Manager</strong> to develop and deliver our events and exhibitions programme, available

我遇到了一个问题。我想在scrapy中使用XPath从以下HTML中提取文本

<div class="block fix-text job-description">
   <p>We’re looking for an experienced <strong>Events Manager</strong> to develop and deliver our events and exhibitions programme, available to start as soon as possible. You’ll be leading a team of two to create and implement an events strategy that supports our corporate objectives. You’ll be working closely with our campaigns, marketing and projects teams to make sure we connect with our audiences and achieve event objectives.</p>
   <p>In this role, you’ll be working within a dynamic team in a fast-paced environment, with the potential opportunity to be part of the recruitment process to build your own team. Your experience as an events manager will have a strong marketing or digital marketing focus, ideally within a regulatory or third sector context.</p>
   <p>You’ll be managing high profile events across our diverse organisation, from workshops and online webinars to our national flagship conference. It’s an exciting role with the opportunity to help shape our current digital transformation and strengthen our brand, so we’re looking for creativity and innovation. You’ll also be working with senior colleagues and stakeholders, for whom you’ll prepare detailed briefings. In addition, you:</p>
   <ul>
      <li>Can demonstrate your extensive experience of creating and managing high profile events and conferences</li>
      <li>Have experience in delivering complex events programmes integrated into campaigns and marketing communications</li>
      <li>Have experience of audience research and insight</li>
      <li>Have excellent budget management and negotiation skills</li>
      <li>Are an outstanding communicator, both verbal and written</li>
      <li>Have strong people management skills with the ability to motivate and develop a team remotely</li>
   </ul>
   <p>This role is the opportunity to work within one of the largest healthcare regulators within the UK, shaping change within healthcare. As part of your salary and benefits package, you’ll receive:</p>
   <ul>
      <li>A good pension (15% employer contribution)</li>
      <li>25 days’ holiday a year (option to buy &amp; sell)</li>
      <li>Private Medical Insurance (PMI) &amp; Health screens</li>
      <li>Interest free ticket loans</li>
      <li>Exclusive discounts</li>
      <li>Employee assistance programme</li>
      <li>Childcare vouchers</li>
      <li>Cycle to work scheme</li>
      <li>Flexi-working</li>
      <li>The option to work from home up to 2 days a week.</li>
   </ul>
   <p>The General Medical Council (GMC) helps to protect patients and improve medical education and practice in the UK by setting standards for medical students and doctors. We support them in achieving (and exceeding) those standards and take action when they’re not met.</p>
   <p>A registered charity, we value diversity and inclusion because our differences make us stronger. So, our processes are fair, objective, transparent and free from discrimination.</p>
   <p><strong>Employment status: 12-month Fixed Term Contract</strong></p>
   <p><strong>Closing date: Midnight on Sunday 1st July 2018, late applications will not be accepted.</strong></p>
   <p><strong>Assessment date: Interviews &amp; Assessments will take place on Wednesday 11th July 2018</strong></p>
</div>

我们正在寻找一位经验丰富的活动经理来制定和交付我们的活动和展览计划,并尽快启动。您将领导一个由两人组成的团队,创建并实施支持我们公司目标的活动战略。您将与我们的活动、营销和项目团队密切合作,确保我们与观众保持联系并实现活动目标

在这个职位上,你将在快节奏的环境中,在一个充满活力的团队中工作,有可能成为招聘过程的一部分,建立自己的团队。您作为活动经理的经验将具有强大的营销或数字营销重点,最好是在监管或第三部门背景下

您将管理我们多元化组织的高知名度活动,从研讨会和在线研讨会到我们的全国旗舰会议。这是一个令人兴奋的角色,有机会帮助塑造我们当前的数字化转型,加强我们的品牌,因此我们正在寻找创造力和创新。您还将与高级同事和利益相关者合作,为他们准备详细的简报。此外,你:

  • 可以展示您在创建和管理高知名度活动和会议方面的丰富经验
  • 具有将复杂活动计划整合到活动和营销传播中的经验
  • 具有受众研究和洞察力的经验
  • 具有优秀的预算管理和谈判技巧
  • 是优秀的口头和书面沟通者
  • 具有较强的人员管理技能,能够远程激励和发展团队
这一角色是在英国最大的医疗监管机构之一内工作的机会,塑造医疗领域的变革。作为薪资和福利待遇的一部分,您将获得:

  • 良好的养老金(15%的雇主供款)
  • 一年25天的假期(买卖期权)
  • 私人医疗保险(PMI)及;健康筛查
  • 免息机票贷款
  • 独家折扣
  • 雇员援助计划
  • 托儿券
  • 工作周期计划
  • 弹性工作
  • 每周最多两天在家工作的选择
英国普通医学委员会(GMC)通过为医学生和医生制定标准,帮助保护患者,改善英国的医学教育和实践。我们支持他们达到(并超过)这些标准,并在没有达到这些标准时采取行动

作为一家注册的慈善机构,我们重视多样性和包容性,因为我们的差异使我们更加强大。因此,我们的程序是公平、客观、透明和没有歧视的

雇佣状态:12个月定期合同

截止日期:2018年7月1日星期日午夜,逾期申请将不予受理。

评估日期:访谈和;评估将于2018年7月11日星期三进行

如何从上面的HTML中提取文本。 我尝试使用XPath来提取文本

  • '//*[@class=“职务描述”]'

  • //[@id=“main”]/div/div/div[1]/div[1]/div/div[2]/div[2]//text()

  • //[@id=“main”]//div[@class=“职务描述”]/'
  • //div[@class=“职务描述”]/p/text()
  • “//div[@class=“job description”]/以下同级::node()/后代或self::text()”
  • 6.'//div[@class=“job description”]/p/genderant或self::text()

    但是没有得到输出。有人能告诉我如何抓取这些信息吗?因为它在类中有多个
    {p}
    标记,
    (ul}
    标记

    所以现在我很困惑如何获取信息


    提前感谢

    您想要什么还不是很清楚,但听起来您需要一个XPath查询,该查询提供所有文本节点。您可以这样做:

    /descendant::text()
    

    我通过以下回答解决了此问题:

    我只放了以下xpath:
    /*[包含(@class,“职务描述”)]/genderant::text()


    谢谢你的评论@Lars Marius Garshol。

    谢谢你的评论。我只想从上面的HTML中提取文本。我尝试了一些我在问题中提到的XPath查询。我尝试了你的建议,也像
    //div[@class=“job description”]/generatant::Text()
    ,但它不起作用。我没有得到文本。