matthewmueller / x-ray

The next web scraper. See through the <html> noise.
MIT License
5.87k stars 349 forks source link

How to get currently scraped URL ? #262

Closed LeoMartinDev closed 7 years ago

DannyCork commented 7 years ago

may appear crude but why not set the url as a variable and then output it? See code below

var Xray = require('x-ray');  
var x = Xray();    
var url = 'http://www.wirdgroup.com' ;

x(url, 'title')(function(err, result) {
    console.log ('Connecting to ' + url);
    console.log('error is ' + err);
    console.log('result is ' + result);
})
simonseddon commented 4 years ago

I think the OP means the currently followed URL, i.e. from a found & followed link inside an x() instance