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

84
Views
Obtenga datos de la página web y verifique un texto en particular usando javascript

Quiero obtener datos de una página web y buscar un texto en particular en ella. Puedo hacerlo usando python pero quiero hacerlo usando javascript. Adjunto el código de python para que pueda entender lo que estoy tratando de hacer y cómo puedo hacerlo usando javascript.

 import requests a = requests.get("http://localhost:3000/data") b = a.text if("wrong" in b): print(b)

Cualquier ayuda será apreciada.

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

0

Puedes hacer una búsqueda de expresiones regulares en javascript así

 fetch('http://google.com') .then(function (response) { switch (response.status) { // status "OK" case 200: let text = response.text(); let n = text.search("W3Schools"); console.log(text,n) // status "Not Found" case 404: throw response; } }) .then(function (template) { console.log(template); }) .catch(function (response) { // "Not Found" console.log(response.statusText); });

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!