added chrome detection evasion techniques

This commit is contained in:
Nikolai Tschacher
2019-02-07 16:09:38 +01:00
parent d5b147296e
commit 7572ebd314
23 changed files with 538 additions and 112 deletions

17
run.js
View File

@@ -6,13 +6,11 @@ let config = {
user_agent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36',
// if random_user_agent is set to True, a random user agent is chosen
random_user_agent: true,
// get meta data of scraping in return object
write_meta_data: false,
// how long to sleep between requests. a random sleep interval within the range [a,b]
// is drawn before every request. empty string for no sleeping.
sleep_range: '[1,2]',
// which search engine to scrape
search_engine: 'marketwatch',
search_engine: 'google',
// whether debug information should be printed
// debug info is useful for developers when debugging
debug: false,
@@ -20,15 +18,15 @@ let config = {
// this output is informational
verbose: true,
// an array of keywords to scrape
keywords: ['MSFT', 'AAPL'],
keywords: ['news'],
// alternatively you can specify a keyword_file. this overwrites the keywords array
keyword_file: '',
// the number of pages to scrape for each keyword
num_pages: 1,
// whether to start the browser in headless mode
headless: false,
headless: true,
// path to output file, data will be stored in JSON
output_file: '',
output_file: 'data.json',
// whether to prevent images, css, fonts from being loaded
// will speed up scraping a great deal
block_assets: true,
@@ -42,6 +40,13 @@ let config = {
// example: 'socks5://78.94.172.42:1080'
// example: 'http://118.174.233.10:48400'
proxy: '',
// check if headless chrome escapes common detection techniques
// this is a quick test and should be used for debugging
test_evasion: false,
// log ip address data
log_ip_address: true,
// log http headers
log_http_headers: true,
};
function callback(err, response) {