Node X-ray Crawling Data From Collection Of Url
I'm trying to scrape a list in a site that leads to other pages that has the same formatting. I was able to create a collection of all the a tags, but when I try to visit a collect
Solution 1:
I ran into that problem before and my solution goes like this:
varXray = require('x-ray');
var x = Xray();
x('http://stackoverflow.com/', {
title: x('a', [{links:'@href'}])
}) (function(err, obj) {
obj.forEach(function(links.link) {
x(links.link, "title")(function(err, data){
console.log(data) // should print the title
});
});
Let me know if you run into any problems.
Solution 2:
You could Use X-ray's Crawling to anoth site
varXray = require('x-ray');
var x = Xray();
x("http://stackoverflow.com/", {
main: 'title',
image: x('#gbar a@href', 'title'), // follow link to google images
})(function(err, obj) {
/*
Post a Comment for "Node X-ray Crawling Data From Collection Of Url"