nev*_*nd9 2 url text-processing
使用 Linux Bash,如何转换文本文件:
http://example.org/
https://en.wikipedia.org/wiki/Main_Page
https://www.youtube.com/watch?v=mGQFZxIuURE
Run Code Online (Sandbox Code Playgroud)
进入:
http://example.org/ Example Domain
https://en.wikipedia.org/wiki/Main_Page Wikipedia, the free encyclopedia
https://www.youtube.com/watch?v=mGQFZxIuURE Mike Perry - The Ocean (ft. Shy Martin) - YouTube
Run Code Online (Sandbox Code Playgroud)
或进入:
http://example.org/
Example Domain
https://en.wikipedia.org/wiki/Main_Page
Wikipedia, the free encyclopedia
https://www.youtube.com/watch?v=mGQFZxIuURE
Mike Perry - The Ocean (ft. Shy Martin) - YouTube
Run Code Online (Sandbox Code Playgroud)
?
怎么可以一个
对该列表中的每个后续 URL 执行这些步骤 1-4?
如果不使用 Linux Bash,还有什么其他方法?
随着curl和小狗:
while IFS= read -r url
do
printf "%s " "$url"
curl -sL "$url" | # fetch the page
pup 'head title:first-of-type text{}' # get the text of the first title tag in head
done < input
Run Code Online (Sandbox Code Playgroud)