I have been having a look at this for a while but I haven't found any answer yet.
I've got a curl command to send a HTTP POST request to a server, then I have created a script called "tmg.sh" which looks like the next one:
#! /bin/bash echo "There you go:" sleep 3s curl "http://tmg.xunta.gal/consulta-tarxeta?blah_blah_blah&numero=$1" echo "Thanks!" Right then, so when I write the next command on the terminal:
chmode u+x ./tmg.sh Because for some reason even in root account if I don't do this, it returns: bash: ./tmg.sh: Permission denied, but anyway let's go on, after I have done that, when I write the following:
./tmg.sh NUMBER_GOES_HERE That number is the variable, then I got this answer:
There you go: <html code not relevant> <div class="infoContido"><p>Non hai ningunha recarga para o número de tarxeta introducido.</p></div> <html code not relevant> Thanks! Right, here comes my question, how can I get just a part of the whole HTML code? I mean, I just want a part of the website, something like this:
Non hai ningunha recarga para o número de tarxeta introducido. Also, I'd like to notice that as I get a full page, there are plenty of <p>, <div>... Is that possible, if it is, how should I edit my script to get just this part?
Thank you so much and have a lovely day!