sromexs / get-sitemap-links Goto Github PK
View Code? Open in Web Editor NEWThis package get, fetch, crawl, sitemap pages recursively and fetch all links in between <loc> tag.
This package get, fetch, crawl, sitemap pages recursively and fetch all links in between <loc> tag.
First of all, thanks for your work here :)
I am using this library for an internal tool and realized that this fails to extract URLs correctly when the loc data is in CDAta format like below
<sitemap>
ย <loc><![CDATA[https://example.com/post-sitemap.xml]]></loc>
ย <lastmod><![CDATA[2020-11-16T18:13:33+00:00]]></lastmod>
</sitemap>
In this case, the expected return value is https://example.com/post-sitemap.xm
but instead we get <![CDATA[https://example.com/post-sitemap.xml]]>
We perhaps need to add a regex somewhere to extract data between CData section
Regex rules may miss-match sometimes
for example code below may find next url https://www.orangemarketing.com</loc><lastmod>2023-01-30</lastmod></url><url><loc>https://www.orangemarketing.com/555
Its contains part of XML sitemap, looks like issue with missing trailing slash
const GetSitemapLinks = require("get-sitemap-links").default;
(async () => {
const array = await GetSitemapLinks(
"https://www.orangemarketing.com/sitemap.xml"
);
console.table(array);
})();
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.