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

244
Views
¿Cómo obtener el sitio de Wikipedia? El acceso para obtener en * desde el origen * ha sido bloqueado por la política CORS

Estoy tratando de mostrar el sitio web de wikipedia en mi sitio, pero tengo un problema con cors. Por favor, ¿alguien puede ayudarme? Probé tantas cosas pero nada me funcionó.

error:

 Access to fetch at 'https://en.wikipedia.org/w/index.php?title=elon_musk&action=render' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

código:

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div id="content"></div> </body> <script> contentUrl = 'https://en.wikipedia.org/w/index.php?title=' afterContentUrl = '&action=render' title="elon_musk" let url = contentUrl + title + afterContentUrl fetch(url) .then(function (response) { return response.text(); }) .then((data) => { console.log(data) document.getElementById('content').innerHTML = data }) </script> </html>

https://www.mediawiki.org/wiki/API:Main_page

Gracias:)

about 4 years ago · Juan Pablo Isaza
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!