apache_conf config.json

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了apache_conf config.json相关的知识,希望对你有一定的参考价值。

{
  "spiders": [
    {
      "name": "china",
      "custom_settings": null,
      "code": {},
      "extractors": [
        {
          "callback": "process_item",
          "item": "NewsItem",
          "attrs": {
            "title": [
              {
                "method": "css",
                "arg": "#chan_newsTitle::text",
                "processor": ""
              }
            ],
            "content": [
              {
                "method": "css",
                "arg": "#chan_newsDetail p::text",
                "processor": "Join()"
              }
            ],
            "datetime": [
              {
                "method": "css",
                "arg": "#chan_newsInfo::text",
                "re": "\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}",
                "processor": ""
              }
            ],
            "url": [
              {
                "method": "attr",
                "arg": "url"
              }
            ]
          }
        }
      ],
      "rules": [
        {
          "restrict_css": [
            ".con_item h2"
          ],
          "callback": "process_item"
        },
        {
          "restrict_xpaths": [
            "//div[@id=\"pageStyle\"]/a[contains(., \"下一页\")]"
          ]
        }
      ],
      "storage": {
        "mysql": {
          "enable": false
        }
      },
      "start_urls": {
        "mode": "list",
        "list": [
          "http://tech.china.com/internet/"
        ],
        "code": null,
        "file": null
      },
      "attrs": [],
      "allowed_domains": [
        "tech.china.com"
      ]
    }
  ],
  "items": [
    {
      "name": "NewsItem",
      "attrs": {
        "title": {
          "in_processor": "",
          "out_processor": "TakeFirst()"
        },
        "content": {
          "in_processor": "",
          "out_processor": "TakeFirst()"
        },
        "datetime": {
          "in_processor": "",
          "out_processor": "TakeFirst()"
        },
        "url": {
          "out_processor": "TakeFirst()"
        }
      }
    }
  ]
}

以上是关于apache_conf config.json的主要内容,如果未能解决你的问题,请参考以下文章

apache_conf config.json

apache_conf config.json

apache_conf config.json

apache_conf 〜/ .homebridge / config.json

apache_conf config.json用于测试复杂的json解析器

apache_conf Sequelize config.json用于不同的数据库