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

Error while fetching URL #70

Closed
Sparinfosys opened this issue May 4, 2018 · 1 comment
Closed

Error while fetching URL #70

Sparinfosys opened this issue May 4, 2018 · 1 comment

Comments

@Sparinfosys
Copy link

Code

import lassie
url = "https://www.eater.com/2018/5/3/17311386/best-restaurants-oakland-bay-area"
lassie.fetch(url)

Error Log


AttributeError Traceback (most recent call last)
in ()
1 url = "https://www.eater.com/2018/5/3/17311386/best-restaurants-oakland-bay-area"
----> 2 lassie.fetch(url)

~/anaconda3/envs/mobi_mule/lib/python3.6/site-packages/lassie/api.py in fetch(url, **kwargs)
41 """
42 l = Lassie()
---> 43 return l.fetch(url, **kwargs)

~/anaconda3/envs/mobi_mule/lib/python3.6/site-packages/lassie/core.py in fetch(self, url, open_graph, twitter_card, touch_icon, favicon, all_images, parser, handle_file_content, canonical)
177 soup = BeautifulSoup(clean_text(html), parser)
178
--> 179 self._filter_amp_data(soup, data, url, all_images)
180
181 if open_graph:

~/anaconda3/envs/mobi_mule/lib/python3.6/site-packages/lassie/core.py in _filter_amp_data(self, soup, data, url, all_images)
394 })
395 elif isinstance(image, object):
--> 396 image_list = image.get('@list')
397 if image_list:
398 for _image in image_list:

AttributeError: 'list' object has no attribute 'get'

michaelhelmick added a commit that referenced this issue May 24, 2018
Fixes #70, fix cases where AMP images was a list but being identified as an object
@michaelhelmick
Copy link
Owner

0.11.6 is released on PyPI

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