elliotgao2 / gain

Web crawling framework based on asyncio.
GNU General Public License v3.0
2.03k stars 207 forks source link

Css selector add attr not work correctly #24

Closed wisecsj closed 6 years ago

wisecsj commented 7 years ago

1.I write code content = Css('.download_button', 'href') in Class Post but not work. Error info :

Selector ".video-download-button" for url was wrong, please check again

which means that value is None.In fact,execute code d(self.rule)[0].attr(self.attr, None) would terminate and output has not attr attribute...

2.Now selector just select the first element since the code d(self.rule)[0].text 。How can i choose the whole elements match self.rule and acquire their attr? (I searched the doc http://pyquery.readthedocs.io/en/latest/, but not found answer)

elliotgao2 commented 7 years ago

By default, I suppose the the item parser only parses the first item from detail page. But I ran into a stone wall when I attempted to parse a page with multiple items.

So I open an issue parse multiple items, which could solve your problem.