0

I am trying to get an element so that the discord bot picks it up and sends it on the discord channel. It currently picks nothing. I am not getting any error though.

else if (tokens[0] === '!gtatime'){
    const response = await axios.get('https://gtalens.com/weather');
    const timedat = cheerio.load(response.data);
    const time = timedat('#app > main > div > div.hero-body > div.hero.is-fullheight.is-clipped.py-4 > div > div > div > div.column.is-half > div.weather__container > h1 > span.is-pulled-right.tag.is-family-primary.has-background-black.has-text-success.is-size-7-mobile.is-medium.ml-1.has-tooltip');
    const timeText = time.text();
    await message.channel.send(timeText);
  }

I am having problems in the const time portion. What can I try next?

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

1

You can inspect the page in the browser and then right-click on the element for which you need a selector and then copy the selector.

I have attached a screenshot for reference, Hope this will help.

enter image description here

Santosh
  • 441
  • 1
  • 4
  • 8