|This is really useful, thank you. I've modified this to only collect the page title at this time (see below). Is it possible however to get the "echo Title: " command I've added to appear on the same line as the outputted data? for example, "Title: Website Name Goes Here", and for when a <title> tag isn't found, for it to still show "Title: " and just leave it blank? :)|
Also, do you know how to only list the FIRST result found and to ignore the ones afterwards? I've found some pages have multiple <title> tags.
Lastly, one really tricky thing I'm trying to do is to ONLY list the text inside the <TITLE> tags and make it appear after "echo Title: " without outputting the actual tags themselves. Sometimes, other code sitting right next to the <TITLE> gets outputted also and things get messy. Ha-ha. Here's a copy of the code so far:
@echo off>"List.txt" & setlocal
for /f "tokens=*" %%a in ('dir /b /s *.htm?') do (>>"List.txt" echo URL: %%a
echo Title: >>"List.txt"
find /I "<TITLE" <%%a>>"List.txt"
I really appreciate your assistance with this by the way. This will make indexing sites much easier for me. Once the code is complete, I'll allow it to also collect the description and keyword tags again, but for now I just hope you can assist! :D :)
message edited by jameswsparker