mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 14:04:38 +02:00
Fake User-Agent Based on My Own
This commit is contained in:
@@ -33,6 +33,9 @@ module.exports = class GoogleCommand extends commando.Command {
|
|||||||
.get(`https://www.google.com/search`)
|
.get(`https://www.google.com/search`)
|
||||||
.query({
|
.query({
|
||||||
q: thingToSearch
|
q: thingToSearch
|
||||||
|
})
|
||||||
|
.set({
|
||||||
|
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.138 Safari/537.36 Vivaldi/1.8.770.54'
|
||||||
});
|
});
|
||||||
const $ = cheerio.load(response.text);
|
const $ = cheerio.load(response.text);
|
||||||
let href = $('.r').first().find('a').first().attr('href');
|
let href = $('.r').first().find('a').first().attr('href');
|
||||||
|
|||||||
Reference in New Issue
Block a user