我想从https://virgool.io/feed/@jEbrahimi
获取数据并在“某些”列表中显示数据
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'))
使用此代码我一无所获
我想获取标题文本并在xml文件中链接href
<title type="text"><![CDATA[استفاده از ری اکت بدون Node.js]]></title>
<link rel="alternate" type="text/html"
href="https://virgool.io/@jEbrahimi/try-react-without-nodejs-
mjscaihovuqa"></link>
我如何获取数据并在<a>
标签的列表中显示它们:
<div className='lastArticle'>
<a href='https://virgool.io/@jEbrahimi/try-react-without-nodejs-
mjscaihovuqa'>استفاده ار ریاکت بدون NodeJS</a>
</div>