yetzt / node-scrapyard

Scrapyard makes scraping websites easy.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error while executing

GlauberF opened this issue · comments

captura de tela de 2018-05-24 16-44-51

my code

var scrapyard = require("scrapyard");
                var scraper = scrapyard();
                var Agent = require('socks5-http-client/lib/Agent');

                scraper({
                    url: uri,
                    headers: {
                        "User-Agent": "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0"
                    },
                    agentClass: Agent,
                    agentOptions: {
                        socksHost: 'localhost',
                        socksPort: 9050
                    },
                    method: "GET",
                    type: "html",
                    encoding: "utf-8"
                }, function(err, $) {
                    if (err) return console.log(err);
                    // $(".content p").each(function() {
                    //     console.log($(this).text());
                    // });
                    console.log($)
                });

this means the scraper was unsuccessful establishing a http connection or the servers http status code wasn't 200. is the uri replying with status 200 and is your tor running properly?