Extracting dates in unusual format

<p class="spot_post_date">2021.06.17. <span class="lt_bar"><span>55,060</span>read</span></p>

I want to extract date in that code
It can’t extract date that setting Item date selector to p.spot_post_date.
How can I delete <span> tag?

When you select the date with p.spot_post_date you’ll get the following string:

2021.06.17. 55,060read

You can delete span elements using Feed Creator’s cleanup by entering p span in the “Source HTML: Remove elements (CSS)” field.

However, doing so will leave with you with the following string:

2021.06.17. 

PHP’s strtotime doesn’t recognise the Y.M.D format, it recognises Y-M-D (with dashes).

So you’ll have to use Feed Creator’s “Item date format” field to guide it. You can enter something like this:

Y.m.d+

The plus (+) sign at the end tells it to ignore the rest of the string, so you can use it even without removing the span elements.

So you enter two pieces of information for the date:

  1. Item date selector (CSS): p.spot_post_date
  2. Item date format: Y.m.d+
1 Like

Thank you so much! please solve this one too!
https://forum.fivefilters.org/t/failed-to-fetch-url-why/1226/3

1 Like