PS C:\Users\Administrator\desktop\bot> node --input-type=module -e " >> import { gotScraping } from 'got-scraping'; >> import useragents from 'user-agents'; >> >> const ua = new useragents({ deviceCategory: 'mobile', platform: 'iPhone' }); >> >> // Paket objesi ile >> const r1 = await gotScraping({ >> url: 'https://httpbin.org/headers', >> headers: { 'User-Agent': ua.toString() } >> }); >> console.log('String UA:', JSON.parse(r1.body).headers['User-Agent']); >> >> // gotScraping'in kendi userAgent parametresiyle >> const r2 = await gotScraping({ >> url: 'https://httpbin.org/headers', >> useragent: ua.toString() >> }); >> console.log('useragent param:', JSON.parse(r2.body).headers['User-Agent']); >> " String UA: Mozilla/5.0 (iPhone; CPU iPhone OS 18_6_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/141.0.7390.41 Mobile/15E148 Safari/604.1 node:internal/modules/run_main:123 triggerUncaughtException( ^ RequestError: Unexpected option: useragent at Request._beforeError (file:///C:/Users/Administrator/desktop/bot/node_modules/got/dist/source/core/index.js:198:21) at file:///C:/Users/Administrator/desktop/bot/node_modules/got/dist/source/core/index.js:115:30 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) at Options.merge (file:///C:/Users/Administrator/desktop/bot/node_modules/got/dist/source/core/options.js:475:27) ... 4 lines matching cause stack trace ... at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 'ERR_GOT_REQUEST_ERROR', input: undefined, timings: undefined, options: Options { _unixOptions: undefined, _internals: { request: undefined, agent: { http: TransformHeadersAgent { agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 80, protocol: 'http:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype] {}, freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: true, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 0, [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false } }, https: TransformHeadersAgent { agent: Agent { _events: [Object: null prototype], _eventsCount: 2, _maxListeners: undefined, defaultPort: 443, protocol: 'https:', options: [Object: null prototype], requests: [Object: null prototype] {}, sockets: [Object: null prototype] {}, freeSockets: [Object: null prototype] {}, keepAliveMsecs: 1000, keepAlive: true, maxSockets: Infinity, maxFreeSockets: 256, scheduling: 'lifo', maxTotalSockets: Infinity, totalSocketCount: 0, maxCachedSessions: 100, _sessionCache: [Object], [Symbol(shapeMode)]: false, [Symbol(kCapture)]: false } }, http2: undefined }, h2session: undefined, decompress: true, timeout: { connect: undefined, lookup: undefined, read: undefined, request: 60000, response: undefined, secureConnect: undefined, send: undefined, socket: undefined }, prefixUrl: '', body: undefined, form: undefined, json: undefined, cookieJar: undefined, ignoreInvalidCookies: false, searchParams: undefined, dnsLookup: undefined, dnsCache: undefined, context: { headerGenerator: HeaderGenerator { globalOptions: { browsers: [Array], operatingSystems: [Array], devices: [Array], locales: [Array], httpVersion: '2', browserListQuery: '', strict: false }, browserListQuery: undefined, inputGeneratorNetwork: BayesianNetwork { nodesInSamplingOrder: [Array], nodesByName: [Object] }, headerGeneratorNetwork: BayesianNetwork { nodesInSamplingOrder: [Array], nodesByName: [Object] }, uniqueBrowsers: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], ... 17 more items ], headersOrder: { safari: [Array], chrome: [Array], firefox: [Array], edge: [Array] }, relaxationOrder: [ 'locales', 'devices', 'operatingSystems', 'browsers', 'browserListQuery' ] }, useHeaderGenerator: true, insecureHTTPParser: true }, hooks: { init: [ [Function: optionsValidationHandler], [Function: customOptionsHook] ], beforeRequest: [ [Function: insecureParserHook], [Function: sessionDataHook], [Function: http2Hook], [AsyncFunction: proxyHook], [AsyncFunction: browserHeadersHook], [Function: tlsHook] ], beforeError: [], beforeRedirect: [ [Function: refererHook] ], beforeRetry: [], beforeCache: [], afterResponse: [] }, followRedirect: true, maxRedirects: 10, cache: undefined, throwHttpErrors: false, username: '', password: '', http2: true, allowGetBody: false, copyPipedHeaders: true, headers: { 'user-agent': undefined }, methodRewriting: false, dnsLookupIpVersion: undefined, parseJson: [Function: parse], stringifyJson: [Function: stringify], retry: { limit: 0, methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ], statusCodes: [ 408, 413, 429, 500, 502, 503, 504, 521, 522, 524 ], errorCodes: [ 'ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN' ], maxRetryAfter: undefined, calculateDelay: [Function: calculateDelay], backoffLimit: Infinity, noise: 100, enforceRetryRules: false }, localAddress: undefined, method: 'GET', createConnection: undefined, cacheOptions: { shared: undefined, cacheHeuristic: undefined, immutableMinTimeToLive: undefined, ignoreCargoCult: undefined }, https: { alpnProtocols: undefined, rejectUnauthorized: false, checkServerIdentity: undefined, serverName: undefined, certificateAuthority: undefined, key: undefined, certificate: undefined, passphrase: undefined, pfx: undefined, ciphers: undefined, honorCipherOrder: undefined, minVersion: undefined, maxVersion: undefined, signatureAlgorithms: undefined, tlsSessionLifetime: undefined, dhparam: undefined, ecdhCurve: undefined, certificateRevocationLists: undefined, secureOptions: undefined }, encoding: undefined, resolveBodyOnly: false, isStream: false, responseType: 'text', url: URL {}, pagination: { transform: [Function: transform], paginate: [Function: paginate], filter: [Function: filter], shouldContinue: [Function: shouldContinue], countLimit: Infinity, backoff: 0, requestLimit: 10000, stackAllItems: false }, setHost: true, maxHeaderSize: undefined, signal: undefined, enableUnixSockets: false, strictContentLength: false }, _merging: false, _init: [ { handlers: [ [Function: fixDecompress] ], mutableDefaults: true, http2: true, https: { rejectUnauthorized: false }, throwHttpErrors: false, timeout: { request: 60000 }, retry: { limit: 0 }, headers: { 'user-agent': undefined }, context: { headerGenerator: HeaderGenerator { globalOptions: [Object], browserListQuery: undefined, inputGeneratorNetwork: [BayesianNetwork], headerGeneratorNetwork: [BayesianNetwork], uniqueBrowsers: [Array], headersOrder: [Object], relaxationOrder: [Array] }, useHeaderGenerator: true, insecureHTTPParser: true }, agent: { http: TransformHeadersAgent { agent: [Agent] }, https: TransformHeadersAgent { agent: [Agent] } }, hooks: { init: [ [Function: optionsValidationHandler], [Function: customOptionsHook] ], beforeRequest: [ [Function: insecureParserHook], [Function: sessionDataHook], [Function: http2Hook], [AsyncFunction: proxyHook], [AsyncFunction: browserHeadersHook], [Function: tlsHook] ], beforeRedirect: [ [Function: refererHook] ] } } ] }, [cause]: Error: Unexpected option: useragent at Options.merge (file:///C:/Users/Administrator/desktop/bot/node_modules/got/dist/source/core/options.js:475:27) at new Options (file:///C:/Users/Administrator/desktop/bot/node_modules/got/dist/source/core/options.js:406:26) at new Request (file:///C:/Users/Administrator/desktop/bot/node_modules/got/dist/source/core/index.js:89:28) at got (file:///C:/Users/Administrator/desktop/bot/node_modules/got/dist/source/create.js:28:25) at file:///C:/Users/Administrator/desktop/bot/[eval1]:15:18 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { options: Options { _unixOptions: undefined, _internals: { request: undefined, agent: { http: TransformHeadersAgent { agent: [Agent] }, https: TransformHeadersAgent { agent: [Agent] }, http2: undefined }, h2session: undefined, decompress: true, timeout: { connect: undefined, lookup: undefined, read: undefined, request: 60000, response: undefined, secureConnect: undefined, send: undefined, socket: undefined }, prefixUrl: '', body: undefined, form: undefined, json: undefined, cookieJar: undefined, ignoreInvalidCookies: false, searchParams: undefined, dnsLookup: undefined, dnsCache: undefined, context: { headerGenerator: HeaderGenerator { globalOptions: [Object], browserListQuery: undefined, inputGeneratorNetwork: [BayesianNetwork], headerGeneratorNetwork: [BayesianNetwork], uniqueBrowsers: [Array], headersOrder: [Object], relaxationOrder: [Array] }, useHeaderGenerator: true, insecureHTTPParser: true }, hooks: { init: [ [Function: optionsValidationHandler], [Function: customOptionsHook] ], beforeRequest: [ [Function: insecureParserHook], [Function: sessionDataHook], [Function: http2Hook], [AsyncFunction: proxyHook], [AsyncFunction: browserHeadersHook], [Function: tlsHook] ], beforeError: [], beforeRedirect: [ [Function: refererHook] ], beforeRetry: [], beforeCache: [], afterResponse: [] }, followRedirect: true, maxRedirects: 10, cache: undefined, throwHttpErrors: false, username: '', password: '', http2: true, allowGetBody: false, copyPipedHeaders: true, headers: { 'user-agent': undefined }, methodRewriting: false, dnsLookupIpVersion: undefined, parseJson: [Function: parse], stringifyJson: [Function: stringify], retry: { limit: 0, methods: [ 'GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE' ], statusCodes: [ 408, 413, 429, 500, 502, 503, 504, 521, 522, 524 ], errorCodes: [ 'ETIMEDOUT', 'ECONNRESET', 'EADDRINUSE', 'ECONNREFUSED', 'EPIPE', 'ENOTFOUND', 'ENETUNREACH', 'EAI_AGAIN' ], maxRetryAfter: undefined, calculateDelay: [Function: calculateDelay], backoffLimit: Infinity, noise: 100, enforceRetryRules: false }, localAddress: undefined, method: 'GET', createConnection: undefined, cacheOptions: { shared: undefined, cacheHeuristic: undefined, immutableMinTimeToLive: undefined, ignoreCargoCult: undefined }, https: { alpnProtocols: undefined, rejectUnauthorized: false, checkServerIdentity: undefined, serverName: undefined, certificateAuthority: undefined, key: undefined, certificate: undefined, passphrase: undefined, pfx: undefined, ciphers: undefined, honorCipherOrder: undefined, minVersion: undefined, maxVersion: undefined, signatureAlgorithms: undefined, tlsSessionLifetime: undefined, dhparam: undefined, ecdhCurve: undefined, certificateRevocationLists: undefined, secureOptions: undefined }, encoding: undefined, resolveBodyOnly: false, isStream: false, responseType: 'text', url: URL {}, pagination: { transform: [Function: transform], paginate: [Function: paginate], filter: [Function: filter], shouldContinue: [Function: shouldContinue], countLimit: Infinity, backoff: 0, requestLimit: 10000, stackAllItems: false }, setHost: true, maxHeaderSize: undefined, signal: undefined, enableUnixSockets: false, strictContentLength: false }, _merging: false, _init: [ { handlers: [ [Function: fixDecompress] ], mutableDefaults: true, http2: true, https: { rejectUnauthorized: false }, throwHttpErrors: false, timeout: { request: 60000 }, retry: { limit: 0 }, headers: { 'user-agent': undefined }, context: { headerGenerator: [HeaderGenerator], useHeaderGenerator: true, insecureHTTPParser: true }, agent: { http: [TransformHeadersAgent], https: [TransformHeadersAgent] }, hooks: { init: [Array], beforeRequest: [Array], beforeRedirect: [Array] } } ] } } } Node.js v20.19.1 PS C:\Users\Administrator\desktop\bot>