2016-11-17 26 views

回答

0

你可以用curl,sed和grep命令输出的组合来完成。

下面是一个例子:

wget -q -O - $(echo http://www.olx.pl/ajax/misc/contact/phone/$(curl -s https://www.olx.pl/oferta/philips-sluchawki-bezprzewodowe-shc5100-CID99-IDiER3w.html#188a0d656b | grep link-phone | egrep -oh \'id\'\:\'\\S+\' | tail -n 1 | sed -e s/\'id\'\://g | sed -e s/\'//g)) 
+0

不幸的是,其不产生任何输出。 – sub199

+0

看起来像grep(颜色)正在添加一些查询字符。这使它失败了。我进一步传送卷曲输出以删除这些字符,如'curl -s | grep link-phone | egrep -oh \'id \'\:\'\\ S + \'|尾巴-n 1 | sed -e s/\'id \'\:// g | sed -e s/\'// g | perl -pe's/\ x1b。*?[mGKH] // g''。它现在像一种魅力。谢谢@ mariuszs80 – sub199