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

Parse multiple item from each page. #7

Closed
elliotgao2 opened this issue Jun 6, 2017 · 0 comments
Closed

Parse multiple item from each page. #7

elliotgao2 opened this issue Jun 6, 2017 · 0 comments

Comments

@elliotgao2
Copy link
Owner

class Post(Item):
    title = Css('.entry-title')
    content = Css('.entry-content')

If a page has multiple item mathed the defined item model, Gain should have ability of parsing all of theme. I have an idea:

class Post(Item):
    __base_html__ =  Css('.entry')
    title = Css('.entry-title')
    content = Css('.entry-content')

Set item model a new attribute named base_html or another appropriate name, which describe where is each item. So that we can parse multiple item from each page.

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

No branches or pull requests

1 participant