michalczaplinski / pitchfork

:notes: Unofficial python API for pitchfork.com reviews.
MIT License
73 stars 18 forks source link

.year() function does not work as intended #10

Closed dhaynespls closed 6 years ago

dhaynespls commented 7 years ago

Caught in unit testing:

https://travis-ci.org/bruno207/pitchfork/jobs/187940542#L252

Sample run:

> python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pitchfork
>>> p = pitchfork.search('mogwai', 'come on')
>>> p.year()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bruno207/.local/lib/python3.5/site-packages/pitchfork/pitchfork.py", line 94, in year
    year = self.soup.find(class_='year').contents[1].get_text()
  File "/home/bruno207/.local/lib/python3.5/site-packages/bs4/element.py", line 730, in __getattr__
    self.__class__.__name__, attr))
AttributeError: 'NavigableString' object has no attribute 'get_text'
>>> 
johnwmillr commented 6 years ago

This issue has been addressed by #13. We intend now to keep this project up to date. Please continue to contribute!