Wkhtmltopdf does not give exact result for google search

wkhtmltopdf without giving exact pdf google search

Wkhtmltopdf team

wkhtmltopdf toc --javascript-delay 5000 --load-error-handling ignore "https://www.google.co.in/search?hl=en&safe=off&client=firefox-beta&hs=1re&tbo=d&rls=org.mozilla%3Aen-US%3Aofficial&channel=fflb&q=height+of+lionel+messi&oq=height+of+lionell&gs_l=serp.3.0.0i13l2j0i13i30.3477969.3479300.0.3480775.7.7.0.0.0.0.233.1161.2j1j4.7.0.les%3B..0.0...1c.1.8wCY6CBhpqY" google.pdf 

Try google search

In this 1.69 m that falls under the Google search box is not displayed

+4
source share
2 answers

I got the answer myself, in case someone encounters the same problem in the future
The problem is that I did not send the "User-Agent"

TRY IT

 wkhtmltopdf --custom-header "User-Agent" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:14.0) Gecko/20100101 Firefox/14.0.1" --custom-header-propagation "https://www.google.co.in/search?hl=en&safe=off&client=firefox-beta&hs=1re&tbo=d&rls=org.mozilla%3Aen-US%3Aofficial&channel=fflb&q=height+of+lionel+messi&oq=height+of+lionell&gs_l=serp.3.0.0i13l2j0i13i30.3477969.3479300.0.3480775.7.7.0.0.0.0.233.1161.2j1j4.7.0.les%3B..0.0...1c.1.8wCY6CBhpqY" google.pdf 
+5
source

Try the command: it will create a desktop version:

 wkhtmltopdf --viewport-size 1280x1024 --orientation Landscape http://site_name.com file_name.pdf 
0
source

All Articles