Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
Código de titiritero para respetar el archivo robots.txt

Esto parece ser posible en Scrapy Scrapy y respecto a robots.txt , pero ¿hay una forma sencilla de hacerlo en Puppeteer?

No he encontrado una manera fácil de incorporar "respetar a los robots" en los comandos de Titiritero.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No creo que el titiritero tenga nada incorporado, pero puede usar el titiritero para acceder a robots.txt y luego usar cualquiera de los módulos npm para analizar robots.txt y ver si tiene permiso para obtener una URL en particular. Por ejemplo, así es como podría usar robots-txt-parser :

 const robotsParser = require('robots-txt-parser') const robots = robotsParser() // Now inside an async function // (or not if using a version of Node.js that supports top-level await) await robots.useRobotsFor('https://example.com/') if (await robots.canCrawl(urlToVisit)) { // Do stuff with puppeteer here to visit the URL } else { // Inform the user that sadly crawling that URL is forbidden }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!