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:

  1. open firefox find box (ctrl + f) on keyword in (without changing source code of firefox)

  2. somehow have firefox open website, save html , quit. (i can't wget) can grep out 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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -