find comments (Mojo::Dom)

瀏覽次數:22 次
跳到第一則未讀訊息

dal...@gmail.com

未讀,
2020年12月9日 凌晨3:26:352020/12/9
收件者:Mojolicious

I'm not sure if this is obvious or not.

I have some *very* old webpages what I need to have archived. But that site used Apache Server Side Includes (yes that old)

So I wanted to see if there are any of these magic comments left. Yes, I can easily do this with a normal find and grep in the commandline, but since I like working with Mojo::DOM I'd like to see if I could do it with this as well.

Is there any way of getting the comments other can looking at the type of all the tags?

I didn't see anything obvious via $dom -> find

Ideas?

/daleif

Lars Madsen

未讀,
2020年12月9日 凌晨3:52:002020/12/9
收件者:mojol...@googlegroups.com
Seems this is probably the easiest

for my $e ( $dom -> descendant_nodes -> each ) {
   next unless $e -> type eq 'comment';
   say $e;
 }

/daleif



--
You received this message because you are subscribed to a topic in the Google Groups "Mojolicious" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mojolicious/mtNMaldt6qI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mojolicious...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mojolicious/9e7f27d2-aa41-4096-b5d3-62a927c921c5n%40googlegroups.com.
回覆所有人
回覆作者
轉寄
0 則新訊息