Thank you for your suggestions.
Quote:
Originally Posted by JimmXinu
BTW, doing both .text and stripHTML() is redundant. I prefer stripHTML() because it does some other stuff and definitely gets all sub tags.
|
I tried it with only stripHTML() but with that the metadata lacked spaces ("Inspired byTitlebyAuthor.") so I added the .text back.
Quote:
Originally Posted by JimmXinu
I haven't tested it recently, but as I recall, it worked to populate a long text(HTML) custom column using yourentryHTML in custom_columns_settings.
|
I tried yourentryHTML but I couldn't get it to work, it ends up not fetching anything. Here are the relevant parts from my personal.ini:
I assume I'm doing something wrong here? 😅 I added the
'https://' + self.getSiteDomain() + alink['href'] part to the code too but it made no difference.
Code:
inspired = metasoup.find('div',{'id':'children'})
seetheend = metasoup.find('a',text='other works inspired by this one')
if inspired:
for alink in inspired.find_all('a'):
if 'http' not in alink['href']:
alink['href']='https://' + self.getSiteDomain() + alink['href']
self.story.setMetadata('inspired',stripHTML(inspired.text))
elif seetheend:
self.story.setMetadata('seetheend','See the end of the work for other works inspired by this one.')