{"action":"created","issue":{"url":"https://api.github.com/repos/IonicaBizau/scrape-it/issues/104","repository_url":"https://api.github.com/repos/IonicaBizau/scrape-it","labels_url":"https://api.github.com/repos/IonicaBizau/scrape-it/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/IonicaBizau/scrape-it/issues/104/comments","events_url":"https://api.github.com/repos/IonicaBizau/scrape-it/issues/104/events","html_url":"https://github.com/IonicaBizau/scrape-it/issues/104","id":319757532,"number":104,"title":"Get URL after redirects","user":{"login":"bfelbo","id":23178145,"avatar_url":"https://avatars2.githubusercontent.com/u/23178145?v=4","gravatar_id":"","url":"https://api.github.com/users/bfelbo","html_url":"https://github.com/bfelbo","followers_url":"https://api.github.com/users/bfelbo/followers","following_url":"https://api.github.com/users/bfelbo/following{/other_user}","gists_url":"https://api.github.com/users/bfelbo/gists{/gist_id}","starred_url":"https://api.github.com/users/bfelbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfelbo/subscriptions","organizations_url":"https://api.github.com/users/bfelbo/orgs","repos_url":"https://api.github.com/users/bfelbo/repos","events_url":"https://api.github.com/users/bfelbo/events{/privacy}","received_events_url":"https://api.github.com/users/bfelbo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-03T00:46:43Z","updated_at":"2018-05-03T02:47:05Z","closed_at":null,"author_association":"NONE","body":"How would I get the URL that scrape-it ends on after it has encountered one or more redirects from the original URL I passed to it?"},"comment":{"url":"https://api.github.com/repos/IonicaBizau/scrape-it/issues/comments/386178713","html_url":"https://github.com/IonicaBizau/scrape-it/issues/104#issuecomment-386178713","issue_url":"https://api.github.com/repos/IonicaBizau/scrape-it/issues/104","id":386178713,"user":{"login":"bfelbo","id":23178145,"avatar_url":"https://avatars2.githubusercontent.com/u/23178145?v=4","gravatar_id":"","url":"https://api.github.com/users/bfelbo","html_url":"https://github.com/bfelbo","followers_url":"https://api.github.com/users/bfelbo/followers","following_url":"https://api.github.com/users/bfelbo/following{/other_user}","gists_url":"https://api.github.com/users/bfelbo/gists{/gist_id}","starred_url":"https://api.github.com/users/bfelbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfelbo/subscriptions","organizations_url":"https://api.github.com/users/bfelbo/orgs","repos_url":"https://api.github.com/users/bfelbo/repos","events_url":"https://api.github.com/users/bfelbo/events{/privacy}","received_events_url":"https://api.github.com/users/bfelbo/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T02:47:05Z","updated_at":"2018-05-03T02:47:05Z","author_association":"NONE","body":"I've tried the following based on https://stackoverflow.com/questions/16687618/how-do-i-get-the-redirected-url-from-the-nodejs-request-module, but `response.headers.location` is undefined. \r\n\r\n```\r\nconst scrapeIt = require(\"scrape-it\")\r\nconst useragent = \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.1 Safari/537.36\"\r\n\r\n// Promise interface\r\nscrapeIt({url: \"http://fb.me/5dVLyJbX8\", headers: { \"User-agent\": useragent }}, {\r\n    title: \"title\"\r\n  , desc: \".header h2\"\r\n  , avatar: {\r\n        selector: \".header img\"\r\n      , attr: \"src\"\r\n    }\r\n}).then(({ data, response, body }) => {\r\n    console.log(`Status Code: ${response.statusCode}`)\r\n    console.log(data)\r\n    console.log(response.headers.location)\r\n    //console.log(response.request.uri.href) // throws error\r\n}).catch((err) => console.log(\"CAUGHT\", err))\r\n```"}}
{"actor":{"display_login":"bfelbo"}}