Created
July 6, 2019 23:20
-
-
Save raicerk/fd8ca7d988126b5bce7bb7a038954765 to your computer and use it in GitHub Desktop.
Comandos para power Shell para descargar los titulos de una pagina web de gif para informaticos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-Title { | |
param([string] $url) | |
$wc = New-Object System.Net.WebClient | |
$data = $wc.downloadstring($url) | |
$title = [regex] '(?<=<title>)([\S\s]*?)(?=</title>)' | |
write-output $title.Match($data).value.trim() | |
} | |
For ($i=0; $i -le 1474; $i++) { | |
$resultado = Get-Title http://www.humordev.com/gif/$i/ | |
$resultado+"| http://www.humordev.com/gif/$i/" >> archivo5.txt | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment