Skip to content

return filters with events.scraper.data #41

Description

@HamedOsama

If I run multiple scrappers with different filters and push it all in array like this:

scraper.on(events.scraper.data, (data) => {
    jobs.push({
      id: data.jobId,
      title: data.title,
      company: data.company,
      link: data.applyLink ? data.applyLink : data.link,
      logo: data.companyImgLink || '',
      deadline: data.date,
      skills: '',
      experience: '',
    });

In this case I can't access the experience which is filter I had already set but it does not exist on type 'IData'

const scrappers = queryArr.map((q) => {
    return [
      {
        query: q,
        options: {
          ...options,
          filters: {
            ...filters,
            experience: [experienceLevelFilter.INTERNSHIP],
          }
        }
      },
      {
        query: q,
        options: {
          ...options,
          filters: {
            ...filters,
            experience: [experienceLevelFilter.ENTRY_LEVEL],
          }
        }
      }
    ]
  })
  

IData type

export interface IData {
  query: string;
  location: string;
  jobId: string;
  jobIndex: number; // Job index during search, only useful for debug
  link: string;
  applyLink?: string;
  title: string;
  company: string;
  companyLink?: string;
  companyImgLink?: string;
  place: string;
  date: string;
  description: string;
  descriptionHTML: string;
  insights: string[];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions