The output would be:
[2017-08-16 13:37:49] <Julien Ehrhart> [Card-summary_large_image] https://www.ft.com/lucycolumn How I lost my 25-year battle against corporate claptrap https://www.ft.com/lucycolumn This is a test.
Two issues here:
The link appears twice (once during the parsing of the card, once during the parsing of the text) -> Acceptable
The emojis are not in the text so they are stripped from the output -> Not acceptable
When a link is shared and user adds additional text, the added text may not be included in the log.
In the following generated sample, "This is a test." is not included.
This is because cssselect extracts only the text node before the . A workaround could be to use
text_content()
:The output would be:
[2017-08-16 13:37:49] <Julien Ehrhart> [Card-summary_large_image] https://www.ft.com/lucycolumn How I lost my 25-year battle against corporate claptrap https://www.ft.com/lucycolumn This is a test.
Two issues here: