来自<a>

时间:2017-04-03 10:42:28

标签: scrapy-spider

<div id="job_14" class="job">
    <a target="_blank" href="https://www.indeed.com/viewjob?t=Associate+Network+System&amp;c=Las+Vegas+Valley+Water+District&amp;l=Las+Vegas%2C+NV&amp;jk=a22e9d1fa81cae52&amp;indpubnum=4385896808151888&amp;atk=&amp;chnl=JobrollSearch" class="jobtitle" rel="nofollow">Associate Network 

how Scrap text from

2 个答案:

答案 0 :(得分:0)

您可以尝试使用css选择器:

response.css('.job a::text')  

转换为选择具有类job的节点 - &gt;选择子节点<a> - &gt;选择当前节点的text值。

答案 1 :(得分:0)

您也可以尝试使用xpath。 CSS选择器转换为xpath然后执行。

{
  "Filters": {

    "complex_filterField": [
      {
        "keyField": "name",
        "valueField": {
          "keyField": "like",
          "valueField": "%aviator%"
        }
      },
      {
        "keyField": "product_id",
        "valueField": {
          "keyField": "like",
          "valueField": "15%"
        }
      }
    ]
  }
}