Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

85
Views
Setting a User Agent in scrape-it

I'm using scrape-it in my node.js scraping tool (for identifying proper keyword usage) but being identified as a bot by some websites and not getting any content. Is there a way to configure a known user agent header for the GET request to bypass the block?

9 months ago · Santiago Trujillo
1 answers
Answer question

0

You can set the headers, including User-agent, by passing an options object to scrape-it:

scrapeIt({
    url: "http://example.com"
  , headers: { "User-agent": "known-user-agent-of-choice" }
},
{
  // some scrapeHTML options ...
})
.then(
 // some code ...
);
9 months ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2023 PeakU Inc. All Rights Reserved.