How to install user agent in w3m

I am using w3m . How do I override the user agent of this text web browser? I tried setting the "User-Agent: blah" header as an example, but I get the following error:

w3m: Can't load blah.
+3
source share
3 answers

I installed the User-Agent by modifying the file ~/.w3m/configand changing the line user_agent. I have the following text, and it works as expected: user_agent Mozilla/5.0 (Linux i686; U; w3m 0.5.3; en). This one does not have: or = characters in it, so that you get an idea of ​​the syntax used.

This is w3m version version 0.5.3.

w3m -header 'User-Agent: blah', , . , w3m, - netcat:

$ netcat -lp 9999
# then in another terminal:
$ w3m -header 'User-Agent: foo' http://localhost:9999
# back at netcat:
GET / HTTP/1.0
User-Agent: w3m/0.5.3
Accept: text/html, text/*;q=0.5, image/*
Accept-Encoding: gzip, compress, bzip, bzip2, deflate
Accept-Language: en;q=1.0
Host: localhost:9999
User-Agent: foo

2 User-Agent, HTTP-.

+3

@richq:

  • w3m- (~/.w3m)
  • ":" "=" (UA) (w3m , )
  • , -header UA - ( )
  • , UA:

    echo 'user_agent <my-UA>' > ~/.w3m/config ( UA <my-UA>)

  • UA - UA, Ex.

    w3m whatsmyuseragent.com -dump ( UA .)

+2
w3m whatsmyua.info -o user_agent='Mozilla/5.0 (Linux i686; U; w3m 0.5.3; en)'

echo -e '"Mozilla/5.0 (Linux i686; U; w3m 0.5.3; en)"\n"Mozilla/5.0 (Linux x86_64; U; w3m 0.5.3; en)"' >.ua

w3m whatsmyua.info -o user_agent="$(shuf -n1 .ua)"
0

All Articles