Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configuration for saving HTML when URL meets a certain pattern #4

Open
BurnzZ opened this issue Nov 30, 2019 · 1 comment
Open

Comments

@BurnzZ
Copy link

BurnzZ commented Nov 30, 2019

Hello @povilasb!

As the title describes, I was wondering if we could implement something like this?

The use case I have is that if a spider is crawling a site with lots of different pages with the crawl logic scattered into the different parts of the code, manually declaring the save_html in the meta might be tedious. I'm proposing of a way that perhaps if the middleware finds a certain pattern in the URL, it will save that HTML.

For example:

HTML_STORAGE = {
    'save_on_url_patterns': [r'website.com/page\d+.html', 'website.com/section-\w+.html']
}

Let me know what you think and I could send a PR.

Cheers!

@BurnzZ BurnzZ changed the title Add configuration for asving HTML when URL meets a certain pattern Add configuration for saving HTML when URL meets a certain pattern Dec 4, 2019
@povilasb
Copy link
Owner

povilasb commented Dec 8, 2019

Sounds good to me :)

I'm not actively using or developing the middleware but if you send a PR I'll be glad to review and merge it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants