Build a Stack Exchange Scraper

  • + 0 comments

    Javascript:

    const questions = input.split('class="question-summary"'); 
    questions.forEach((question) => {
      const parts = /question-summary-(\d+).*?class="question-hyperlink">\s*(.*?)\s*<.*?class="relativetime">\s*(.*?)\s*</gs.exec(question);
    
      if (parts) {
        parts.shift();
        console.log(parts.join(';'));    
      }
    });