I'm trying to do translate a web page automatically with a shell script. Here is the interesting part:
wget http://www.google.com/translate?langpair=en%7Ces&u=http%3A%2F%2Fasdf.com
I'm getting the "ERROR 403: Forbidden" even though I can get the translation when using this URL in browser. Could someone explain what's going on? Why google forbids the "translator" usage from shell script? Do they monitor user agent or they have another way to tell if you are a browser or not?
If someone knows another way to do it (for example if there is a console non-interactive browser that would fetch that URL or, perhaps there is another online translation tool I'm not aware of) please let me know.
Yes, they check the user agent. Add the -U option to wget, like this:
I tested on my machine and I was able to get the page.
Update: Make sure you put quotes around the url (I used single quotes), because the & separator backgrounds everything before it, and the rest gets interpreted as a separate command.