View previous topic :: View next topic |
Author |
Message |
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Thu Sep 04, 2014 7:57 am Post subject: google searching and parsiing from cli [answered] |
|
|
hello, I have a question, I need to search a string on a specific site as part of a script and download the first hit (if exists)
does someone knows how to do that? _________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein
Last edited by DaggyStyle on Thu Sep 04, 2014 10:40 am; edited 1 time in total |
|
Back to top |
|
|
DaggyStyle Watchman
Joined: 22 Mar 2006 Posts: 5909
|
Posted: Thu Sep 04, 2014 10:39 am Post subject: |
|
|
to answer myself, this will extract a link from google search
Code: | wget -qO- -U 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:31.0) Gecko/20100101 Firefox/31.0' "http://www.google.com/search?q=\"bla\" site:site.com" | grep "http://site.com" | tr '"' '\n' | grep "http://site.com" |
_________________ Only two things are infinite, the universe and human stupidity and I'm not sure about the former - Albert Einstein |
|
Back to top |
|
|
|