JSFiddle - React, Tailwind, and code Playground

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<button>
Çalıştır
</button>
<pre id="console_output"></pre>
<div class="divinclassi"><a href="https://siteadi.com/" title="abc" alt="abc">Bağlantı Metni 1</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Görünmeyecek Metin</div>
<div class="divinclassi"><a href="https://siteadi.com/" title="abc" alt="abc">Bağlantı Metni 2</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Görünmeyecek Metin</div>
<div class="divinclassi"><a href="https://siteadi.com/" title="abc" alt="abc">Bağlantı Metni 3</a>&nbsp;&nbsp;&nbsp;Görünmeyecek Metin</div>
<div class="divinclassi"><a href="https://siteadi.com/" title="abc" alt="abc">Bağlantı Metni 4</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Görünmeyecek Metin</div>
<div class="divinclassi"><a href="https://siteadi.com/" title="abc" alt="abc">Bağlantı Metni 5</a>&nbsp;Görünmeyecek Metin</div>

JavaScript

$("button").click(function(){
let urls = [];
$("div.divinclassi").html(function (i, html) {
    return html.replace(/&nbsp;/g, '');
});
$(".divinclassi").each(function() {
urls.push($(this).prop("outerHTML"));
});
console.log(urls.join(""));

$("#console_output").text("Konsol çıktısı: " + urls.join(""));

});