parser icon indicating copy to clipboard operation
parser copied to clipboard

feat: Improve parser to accept postman-request options

Open david0leong opened this issue 6 years ago • 3 comments

Improvement Rationale

I am using mercury-parser to extract content of RSS feed articles, but my scraping script failed to extract some articles because SSL certificate of article's website was expired or invalid.

After reviewing the source code of mercury-parser, I found that it was using postman-request, which supports strictSSL flag in fetch options.

By setting strictSSL to false, my scraping script was able to successfully scrape the content.

So, I updated mercury-parser to accept fetch options of mercury-parser to make consumers able to fully utilize postman-request under the hood.

david0leong avatar Aug 09 '19 13:08 david0leong

Hi @toufic-m Would you review this PR when you have time?

david0leong avatar Aug 10 '19 06:08 david0leong

@mtashley Could you review this PR when you have time?

david0leong avatar Aug 27 '19 09:08 david0leong

Hi @david0leong, thanks for your support on the project! Would it be possible for you to add a few tests to pertaining to the updated functionality?

mtashley avatar Aug 27 '19 16:08 mtashley

Hello! Sorry for such a late reply on this but I think we're going to deny this pull request. I recognize the problem you're facing here, but exposing the internal request mechanism like this ties the library to a dependency in a way that removes some flexibility for any future changes to its internals.

My recommendation is to make this change in a fork for your scraper (which is honestly probably what you've done, since this issue was opened many years ago). If this problem comes up again, perhaps we can expose a first-party option to allow expired certificates that doesn't rely on passing options directly to the underlying request library.

Thanks for your contribution nonetheless! If you're not satisfied by this response, please feel free to open a new issue related to it and we can discuss a different option.

johnholdun avatar Aug 10 '22 22:08 johnholdun