I have always seen everywhere in JSOUP
code.
Useragent
is set to Mozilla .
What if i want to set it to google chrome or opera?
Jsoup.connect(url)
.userAgent("Mozilla");
How i can achieve this? Thanks in advance.
go there :
http://www.useragentstring.com/pages/Opera/ or http://www.useragentstring.com/pages/Chrome/
and get the one you like.
for example:
Jsoup.connect(url).userAgent("Opera/9.80 (Macintosh; Intel Mac OS X 10.6.8; U; fr) Presto/2.9.168 Version/11.52");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With