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

129
Views
This Keyword inside Callback Function

I have a newbie question.

For some reason my code can't access the value stored in the keyword: this.Selector (last line of code). I think it must have something to do that it's a callback function but I don't what and how to change it.

 class Test {
    constructor(url, range, Selector){
      this.url = url;
      this.range = range;
      this.Selector = Selector
    }

async puppi(){
    const browser =  await puppeteer.launch({headless: true});
    const page =  await browser.newPage();
    await page.goto(this.url);

    const Voucher =  await page.evaluate(()=>{
    let GrapCoupons = document.querySelectorAll(this.Selector);

If you know why, then it would mean a lot to me since I am totally stucked.

Thanks in advance!!

about 4 years ago · Santiago Gelvez
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!