ultimate-sitemap-parser icon indicating copy to clipboard operation
ultimate-sitemap-parser copied to clipboard

Convert SitemapNewsStory to dict

Open J535D165 opened this issue 6 years ago • 0 comments

usp.objects.page.SitemapNewsStory has no attribute __dict__ because of the usage of slots. Therefore, vars() and __dict__() don't work. It would be nice to have an option to parse the attributes to a dict.

In [39]: a[-1].__dict__()                                                                                                                                                                                   
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-39-ab06281650cf> in <module>
----> 1 a[-1].__dict__()

AttributeError: 'SitemapPage' object has no attribute '__dict__'

In [40]: vars(a[-1])                                                                                                                                                                                        
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-40-ada32e179a17> in <module>
----> 1 vars(a[-1])

TypeError: vars() argument must have __dict__ attribute

Thanks for this lib. Works well.

J535D165 avatar Aug 06 '19 09:08 J535D165