File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
content/academy/anti_scraping/mitigation Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ const fingerprintGenerator = new FingerprintGenerator({
30
30
});
31
31
32
32
// Grab a fingerprint from the fingerprint generator
33
- const { fingerprint } = fingerprintGenerator .getFingerprint ({
33
+ const generated = fingerprintGenerator .getFingerprint ({
34
34
locales: [" en-US" , " en" ]
35
35
});
36
36
```
@@ -65,20 +65,20 @@ const fingerprintGenerator = new FingerprintGenerator({
65
65
});
66
66
67
67
// Grab a fingerprint
68
- const { fingerprint } = fingerprintGenerator .getFingerprint ({
68
+ const generated = fingerprintGenerator .getFingerprint ({
69
69
locales: [" en-US" , " en" ]
70
70
});
71
71
72
72
// Create a new browser context, plugging in
73
73
// some values from the fingerprint
74
74
const context = await browser .newContext ({
75
- userAgent: fingerprint .userAgent ,
76
- locale: fingerprint .navigator .language ,
75
+ userAgent: generated . fingerprint .userAgent ,
76
+ locale: generated . fingerprint .navigator .language ,
77
77
});
78
78
79
79
// Attach the fingerprint to the newly created
80
80
// browser context
81
- await fingerprintInjector .attachFingerprintToPlaywright (context, fingerprint );
81
+ await fingerprintInjector .attachFingerprintToPlaywright (context, generated );
82
82
83
83
// Create a new page and go to Google
84
84
const page = await context .newPage ();
You can’t perform that action at this time.
0 commit comments