We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need to access the url of a request after it has been redirected e.g:
function(err, resp,body){ $ = cheerio.load(body); //console.log(jar.cookies); request.post({ jar:jar, url:targetBaseURL+'/search.php?do=process', followAllRedirects: true, headers: { 'User-Agent': userAgent }, form :{ 's' : '', 'do' : 'process', 'searchthreadid': '0', 'query' : '', 'titleonly' : '0', ... proxy: 'http://127.0.0.1:8888' }, function(err, resp, body){ console.log(resp.request.redirects); // array is empty $ = cheerio.load(body); $("[id*=post]").each(function(i, elem){ var title =$(elem).find('a strong'); if(!$(title).text().match(/livescores/i)) { //console.log($(title).text().trim()); var post = $(elem).find('div > em'); //console.log($(post).text().trim()); } }); }) });
The text was updated successfully, but these errors were encountered:
look in response.request.redirects, it has an array of the redirect urls.
Sorry, something went wrong.
@spollack Thanks. Unfortunately, its an empty array.
This gives me what I need console.log(resp.request.uri.href);
Found here - http://stackoverflow.com/questions/16687618/how-do-i-get-the-redirected-url-from-the-nodejs-request-module
No branches or pull requests
I need to access the url of a request after it has been redirected e.g:
The text was updated successfully, but these errors were encountered: