Quote:
Originally Posted by JimmXinu
Well, I still don't see the keywords. I wonder if it's a skin issue.
|
They aren't displayed. They are in the <head> section of the source as a attributes of a meta tag. Firefox will display this when you show the page info.
Quote:
But I found parsing the 'tags' to be very easy. Attached is a version that adds the site specific metadatum 'eroticatags' for literotica.com only.
|
That only works for a single page story. These tags are on the last page. See
http://www.literotica.com/s/chandra as an example.
The full code I have is:
Code:
categories = soup.find("meta", {"name":"keywords"})['content'].split(', ')
categories = [c for c in categories if not self.story.getMetadata('title') in c]
if self.story.getMetadata('author') in categories:
categories.remove(self.story.getMetadata('author'))
for category in categories:
self.story.addToList('category', category.title())
That's a little bit clumsy and I should clean it up a bit.