How can i get a part of the sorce code of a site for exampel if i would for say to ony want to get this part of code
<span class="definition">Används när man säger hejdå till någon. Ha de G är samma sak som ha det bra, eller ha det gött.</span><br /><br />
Form alot of code, and i want to do this in Javascript, and the code is comming from an external site, NAd this is node.js
The general technique you're talking about is called 'web scraping', and it can range from very simple to very complex. Assuming you're looking to do this in a node app (as your tags suggest), I'd suggest using the modules request and cheerio. If part of the html is generated by clientside javascript, this won't be sufficient, but you didn't indicate that in your question. Here's a pretty simple code snippet that describes what I'm suggesting:
const cheerio = require('cheerio');
const request = require('request');
request.get('http://example.com/index.html', (err, response, body) => {
const $ = cheerio.load(body);
const definitions = $('span.definition');
console.log(definitions); // these are all selection result elements, you can do more with them here once you see what they contain.
});
You can use cheerio
const request = require("request");
const cheerio = require("cheerio");
request("http://example.com/some-uri", (err, response, body) => {
if(err)
throw err; //Handle error
let $ = cheerio.load(body);
let myElement = $('span.definition');
console.log(myElement.html()); //Inner html
console.log($.html(myElement)); //outer html
});