clips / pattern

Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.
https://github.com/clips/pattern/wiki
BSD 3-Clause "New" or "Revised" License
8.76k stars 1.58k forks source link

[BUG] typo in `web/__init__.py` #190

Open ghost opened 7 years ago

ghost commented 7 years ago

Line 3756: should be attrs instead of attr

Current: if self.classes.issubset(set([s.lower() for s in e.attr.get("class", [])])) is False:

Should be: if self.classes.issubset(set([s.lower() for s in e.attrs.get("class", [])])) is False:

markus-beuckelmann commented 7 years ago

@siryog90, both statements should be identical since attr and attrs are actually just synonyms in the Element class (see line 3095 in /web/__init__.py). Does it raise any exception on your system?

ghost commented 7 years ago

@markus-beuckelmann yup. Couldn't find an attribute attr. Worked perfectly once I renamed it to attrs.

markus-beuckelmann commented 7 years ago

@siryog90, interesting. Would you provide us with more information on this please, maybe a traceback? What version are you running and what is the value of e in your case?