I’m using w3m. How do I go about overriding the user agent of this text based web browser? I have tried setting -header “User-Agent: blah” as an example, but I get the following error:
w3m: Can't load blah.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I set the User-Agent by modifying the file
~/.w3m/configand modifying theuser_agentline. I have the following text and it seems to work as expected:user_agent Mozilla/5.0 (Linux i686; U; w3m 0.5.3; en). That has no : or = signs in it, just so you get an idea of the syntax used.This is with w3m version 0.5.3.
You can also set it with
w3m -header 'User-Agent: blah'but the problem there is that it appears twice in the request. You can see the headers that w3m uses if you set up a netcat “webserver”:So it sends 2 User-Agent strings, which may not be parsed correctly by the real HTTP server.