{"action":"created","issue":{"url":"https://api.github.com/repos/bitinn/node-fetch/issues/526","repository_url":"https://api.github.com/repos/bitinn/node-fetch","labels_url":"https://api.github.com/repos/bitinn/node-fetch/issues/526/labels{/name}","comments_url":"https://api.github.com/repos/bitinn/node-fetch/issues/526/comments","events_url":"https://api.github.com/repos/bitinn/node-fetch/issues/526/events","html_url":"https://github.com/bitinn/node-fetch/issues/526","id":364453952,"node_id":"MDU6SXNzdWUzNjQ0NTM5NTI=","number":526,"title":"Unsupported browser","user":{"login":"GConejos","id":29734651,"node_id":"MDQ6VXNlcjI5NzM0NjUx","avatar_url":"https://avatars1.githubusercontent.com/u/29734651?v=4","gravatar_id":"","url":"https://api.github.com/users/GConejos","html_url":"https://github.com/GConejos","followers_url":"https://api.github.com/users/GConejos/followers","following_url":"https://api.github.com/users/GConejos/following{/other_user}","gists_url":"https://api.github.com/users/GConejos/gists{/gist_id}","starred_url":"https://api.github.com/users/GConejos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GConejos/subscriptions","organizations_url":"https://api.github.com/users/GConejos/orgs","repos_url":"https://api.github.com/users/GConejos/repos","events_url":"https://api.github.com/users/GConejos/events{/privacy}","received_events_url":"https://api.github.com/users/GConejos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-27T12:34:07Z","updated_at":"2018-09-27T13:54:59Z","closed_at":null,"author_association":"NONE","body":"When I make the request for a url, there are times when I return the information correctly and other times I return the page that indicates that the browser is not compatible. For the same url, either of the two cases can happen to me."},"comment":{"url":"https://api.github.com/repos/bitinn/node-fetch/issues/comments/425101777","html_url":"https://github.com/bitinn/node-fetch/issues/526#issuecomment-425101777","issue_url":"https://api.github.com/repos/bitinn/node-fetch/issues/526","id":425101777,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTEwMTc3Nw==","user":{"login":"GConejos","id":29734651,"node_id":"MDQ6VXNlcjI5NzM0NjUx","avatar_url":"https://avatars1.githubusercontent.com/u/29734651?v=4","gravatar_id":"","url":"https://api.github.com/users/GConejos","html_url":"https://github.com/GConejos","followers_url":"https://api.github.com/users/GConejos/followers","following_url":"https://api.github.com/users/GConejos/following{/other_user}","gists_url":"https://api.github.com/users/GConejos/gists{/gist_id}","starred_url":"https://api.github.com/users/GConejos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GConejos/subscriptions","organizations_url":"https://api.github.com/users/GConejos/orgs","repos_url":"https://api.github.com/users/GConejos/repos","events_url":"https://api.github.com/users/GConejos/events{/privacy}","received_events_url":"https://api.github.com/users/GConejos/received_events","type":"User","site_admin":false},"created_at":"2018-09-27T13:54:59Z","updated_at":"2018-09-27T13:54:59Z","author_association":"NONE","body":"Thank you for your response. I have added the 'User-Agent' to headers and now the problem is resolved.\r\n\r\nWe are trying to parse a response from TripAdvisor and somethimes we get a search result and sometimes we get a response with an empty search result. Does anyone know from experience whether TripAdvisor is detecting that the request is coming from node-fetch and is limiting the service?\r\n\r\n`\r\n    let url = 'https://www.tripadvisor.es/Search?q=pedro&geo=187427';\r\n\r\n    fetch(url, {\r\n            method: 'GET',\r\n            headers:  {\r\n                'User-Agent': 'Mozilla/5.0'\r\n            }\r\n        })\r\n        .then((res) => res.text())\r\n        .then((html) => {\r\n\r\n            //Get only the body of html\r\n            var body = html.substring(html.indexOf(\"<body\"), html.indexOf(\"</body>\") + 7);\r\n\r\n            //Remove all scripts from the body\r\n            var script;\r\n            do {\r\n                script = body.substring(body.indexOf(\"<script\"), body.indexOf(\"</script>\") + 9);\r\n                body = body.replace(script, '');\r\n            }\r\n            while (body.indexOf(\"<script\") > 0);\r\n            //JQuery\r\n            return new Promise((res, rej) => {\r\n                let $ = cheerio.load(body);\r\n                res($)\r\n            });\r\n\r\n        })\r\n        .then(($) => {\r\n`"}}
{"actor":{"display_login":"GConejos"}}