For your second question read this post from @Fox ,
maybe its what you need. Its in Russian, but you can
use translator. There is an example script too >
use http client if you want speed . if browser is only solution then you need to disable everything you can ex . images, scripts and other blockable objects .