bquery can sutomatic recognition the web document charset, but special circumstances you can also set docuemnt's charset.
var buquery =require("buqery");
bquery.query({
"url":"https://github.com/",
"selector":"ul.header-nav.left>li",
"charset":"utf-8",
"extract":{
"title":{},
"url":{
"selector":"a",
"extract":"href"
}
}
}).then(function(docs){
console.log(docs);
})
You can also set the timeout period for the request.
bquery.query({
"url":"https://github.com/",
"selector":"ul.header-nav.left>li>a",
"timeout":3000
});
Sometimes you need to modify the page content link css, javascript or other content before you fetch the docuemnt content. you can use "preSelect" option.
bquery.query({
"url":"https://github.com/",
"selector":"ul.header-nav.left>li",
"preSelect":function($){//=> $ is a cheerio object, you can do any operate wich base on cheerio