Yeni site için yeni scraper

master
Efe 3 years ago
parent 38614c43f3
commit 1252c68917
  1. 5
      kafeterya.sh

@ -3,7 +3,6 @@
url='https://kafeterya.metu.edu.tr/' url='https://kafeterya.metu.edu.tr/'
outfile='kafe.txt' outfile='kafe.txt'
echo "Günün yemeği:" > ${outfile} echo "# Günün yemeği:" >> ${outfile}
curl -s ${url} | /snap/bin/xmllint --html --xpath '//div[@class="yemek"]/p' --format - | sed -e 's/<[^>]*>//g' -e '/*/d' -e 's/^/+ /g' -e 's/./\L&/g4' >> ${outfile} curl -s ${url} | grep "<h2>" | cut -d '>' -f3 | cut -d '<' -f1 | sed -e 's/<[^>]*>//g' -e '/*/d' -e 's/^/+ /g' -e 's/./\L&/g4' | sed '5,6d'| less >> ${outfile}
python3 kafeterya.py

Loading…
Cancel
Save