I want to fetch data from https://virgool.io/feed/@jEbrahimi
and show data in Some list
fetch('https://virgool.io/feed/@jEbrahimi', { 'mode': 'no-cors' })
.then(xml => xml.text())
.then(xmlText => {
var domParser = new DOMParser()
let doc = domParser.parseFromString(xmlText, 'text/xml')
console.log('doc: ', doc);
})
.catch(() => console.error('Error in fetching the website'))
i get nothing with this code
i want to get title text and link href in xml file
<title type="text"><![CDATA[استفاده از ری اکت بدون Node.js]]></title>
<link rel="alternate" type="text/html"
href="https://virgool.io/@jEbrahimi/try-react-without-nodejs-
mjscaihovuqa"></link>
how can i get the data and show them in the list whit <a>
tag:
<div className='lastArticle'>
<a href='https://virgool.io/@jEbrahimi/try-react-without-nodejs-
mjscaihovuqa'>استفاده ار ریاکت بدون NodeJS</a>
</div>
` (for example) when XML will throw an error because it expects `
` – freefaller May 07 '19 at 07:24