{"repo":"jocmp/mercury-parser","free":true,"listed":false,"github":"https://github.com/jocmp/mercury-parser","clone":"git clone https://github.com/jocmp/mercury-parser.git","description":"Extract meaningful content from the chaos of a web page","language":"JavaScript","stars":23,"topics":["article-parser","content-extraction","html-parser","javascript","mercury-parser","nodejs","readability","reader-mode","rss","web-scraping"],"license":"MIT","category":"scrapers-browser-automation","readme_excerpt":"Mercury Parser - Extracting content from chaos Mercury Parser extracts the bits that humans care about from any URL you give it. That includes article content, titles, authors, published dates, excerpts, lead images, and more. Mercury Parser allows you to easily create custom parsers using simple JavaScript and CSS selectors. This allows you to proactively manage parsing and migration edge cases. There are many examples available along with documentation. How? Like this. Installation Usage The result looks like this: If Parser is unable to find a field, that field will return null . parse() Options Content Formats By default, Mercury Parser returns the content field as HTML. However, you can override this behavior by passing in options to the parse function, specifying whether or not to scrape all pages of an article, and what type of output to return (valid values are 'html' , 'markdown' , and 'text' ). For example: This returns the the page's content as GitHub-flavored Markdown: Custom Request Headers You can include custom headers in requests by passing name-value pairs to the parse function as follows: Pre-fetched HTML You can use Mercury Parser to parse custom or pre-fetched HTML by passing an HTML string to the parse function as follows: Note that the URL argument is still supplied, in order to identify the web site and use its custom parser, if it has any, though it will not be used for fetching content. The command-line parser Mercury Parser also ships with a CLI, mea","default_branch":null,"files":null,"tree":[],"storefront":"/r/jocmp","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jocmp/mercury-parser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}