-
Notifications
You must be signed in to change notification settings - Fork 541
Description
Currently default value of fingerprint_generator argument of PlaywrightCrawler.__init__ is None. Use DefaultFingerprintGenerator() instead.
Add helper method to FingerprintGenerator that will override some fingerprint generation settings of already initialized FingerprintGenerator and add something like "allow_init_overrides" flag to FingerprintGenerator.
FingerprintGenerator should then support something like this:
fg = FingerprintGenerator(some_args..., allow_init_overrides=True)
fg.override_init(some_args...) -> "Will override settings"
fg = FingerprintGenerator(some_args..., allow_init_overrides=False)
fg.override_init(some_args...) -> "Will raise an error"
PlaywrightCrawler will have DefaultFingerprintGenerator(allow_init_overrides=True) in init and then it can use some PlaywrightCrawler.__init__ args override FingerprintGenerator settings -> for example browsertype.
On the other hand user can forbid such overrides if they pass FingerprintGenerator(some_args..., allow_init_overrides=False)