Translate web page from shell
-
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.
-
Answer:
Yes, they check the user agent. Add the -U option to wget, like this: wget -U "Mozilla/5.0" 'http://www.google.com/translate?langpair=en%7Ces&u=http%3A%2F%2Fasdf.com' 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.
facha at Server Fault Visit the source
Related Q & A:
- How To Zoom Web Page?Best solution by Stack Overflow
- How To Find Owner Of The Web Page?Best solution by networksolutions.com
- How can I secure my web page?Best solution by Information Security
- How to extract text from web page?Best solution by Stack Overflow
- How to fetch data from web page?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.