You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A partire da un file che contiene soltanto i nomi dei comuni e con il ritorno a capo alla linux (solo LF)
Comune di Burgos
Comune di Buriasco
Comune di Burolo
Comune di Buronzo
Comune di Busachi
… with 56 more lines
puoi fare un ciclo che ogni riga usa googler e raccoglie l'output
#!/bin/bash### requisiti #### googler https://github.com/jarun/googler# miller https://github.com/johnkerl/miller### requisiti ###set -x
# se il file dei risultati esiste già, cancellaloif [ -f ./result.jsonlines ];then
rm ./result.jsonlines
fi# per ogni comune in lista cerca su google ed estrai il primo risultatowhileread p;do
googler -n 1 -c it -l it-IT --json "$p">./tmp.json
title=$(jq <tmp.json -r '.[0].title')
URL=$(jq <tmp.json -r '.[0].url')# inserisci l'output in un file jsonlinesecho'{"stringa":"'"$p"'","URL":"'"$URL"'","title":"'"$title"'"}'>>./result.jsonlines
done<./lista.txt
# converti il jsonlines in un file csv
mlr --j2c unsparsify ./result.jsonlines >./result.csv
Buonasera :-)
Come si può estrarre da google l'url del sito ufficiale di un gruppo Comuni?
Elenco dei comuni da con url mancante
stemmi_comuni_italiani - comuni_no_url.csv
The text was updated successfully, but these errors were encountered: