phpspider icon indicating copy to clipboard operation
phpspider copied to clipboard

教程里第一个demo是不能运行的

Open ufoe opened this issue 8 years ago • 3 comments

$configs = array(
    'name' => '糗事百科',
    'domains' => array(
        'qiushibaike.com',
        'www.qiushibaike.com'
    ),
    'scan_urls' => array(
        'http://www.qiushibaike.com/'
    ),
    'content_url_regexes' => array(
        "http://www.qiushibaike.com/article/\d+"
    ),
    'list_url_regexes' => array(
        "http://www.qiushibaike.com/8hr/page/\d+\?s=\d+"
    ),
    'fields' => array(
        array(
            // 抽取内容页的文章内容
            'name' => "article_content",
            'selector' => "//*[@id='single-next-link']",
            'required' => true
        ),
        array(
            // 抽取内容页的文章作者
            'name' => "article_author",
            'selector' => "//div[contains(@class,'author')]//h2",
            'required' => true
        ),
    ),
);
$spider = new phpspider($configs);
$spider->start();

这个例子是不能直接运行的

ufoe avatar Dec 23 '16 07:12 ufoe

我的也是,放在服务器也不行~显示unknow error

Noah-RD avatar Sep 21 '17 10:09 Noah-RD

楼主解决了吗?

chengfan2017 avatar Dec 24 '17 12:12 chengfan2017

不要删除注释!!

Noah-RD avatar Dec 25 '17 07:12 Noah-RD