I am trying to scrape the site "https://shmoti.com
" . But unfortunately node-fetch's fetch
method is not at all getting the response. It works fine for other websites.
Here is my code
const fetch = require("node-fetch")
fetch('https://shmoti.com', options = {headers : {'User-Agent' : 'Mozilla/5.0'}}).then(res=>res.text()).then(res=>console.log(res))
The first promise which resolves the response object is pending all the time.
I have even tried having a User-Agent . I have set a timeout of 60 seconds .
I can successfully scrape this site using scrapy
library in python but with fetch
method , it always times out.
Why is this happening ? How can I fix this ?
I can ping the website and open it in my browser too , but only the fetching from node is not working.