0

Let's say for example I create a HTML input towards a URL.

https://en.m.wikipedia.org/wiki/JavaScript

The data I want to scrape would be the title and some headings.

Javascript, History and Trademark.

So that I can display them inside div elements after a URL has been specified.

Is that at all achievable within the confines of HTML/css/javascript?

  • JavaScript in general, yes. Browserside JavaScript only if the site gives you [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) permissions via [ACAO](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin) (unlikely if the target page is not under your control). – Amadan Feb 01 '22 at 03:21
  • Ah okay! Thank you. I've been building a project that creates a printable point of sale and thought it would be a lot more foolproof to scrape data instead of manually input, but without permission, the idea sounds dead in the water. – Matthew Fletcher Feb 01 '22 at 03:27
  • 1
    Serverside scripting is not limited in this way — any serverside technology (aside from static HTML, of course) should be able to perform such a request: Node.js, Ruby, Python, PHP, Java... – Amadan Feb 01 '22 at 03:28
  • @K.KDesgins what would be the point of a security system that has a button saying "disable me" on the outside? See [Trying to use fetch and pass in mode: no-cors](https://stackoverflow.com/questions/43262121/trying-to-use-fetch-and-pass-in-mode-no-cors/43268098) — `{ mode: 'no-cors' }` makes things _worse_. – Amadan Feb 01 '22 at 03:30

0 Answers0