bash - Controlling Firefox through terminal -
i writing script involves showing user webpage on basis of requirements (which take inputs) , opening in firefox. instance, crude version of :
#!/bin/bash read -p "what want search" search_term link=$(echo "http://www.mywebsite_whatever.com/search?q="$search_term) firefox $link the major problem cannot wget/urllib website since don't have permission.
now want :
have user on keywords on webpage. want either:
open firefox
findbox (ctrl + f) on keyword in (without changing source code of firefox)somehow have firefox open website, save html , quit. (i can't wget) can
grepout keywords desired. [please don't start off on how unethical , all. doing merely exercise]
i working on linux.
use wget --user-agent switch website thinks you're using firefox, example
wget --user-agent="mozilla/5.0 (x11; ubuntu; linux i686; rv:12.0) gecko/20100101 firefox/12.0" of course, permanent script should instead use --user-agent="myscript/1.0 (http://mywebsite/)" or similar if goes haywire know contact.
Comments
Post a Comment