MeiK2333 / pyppeteer_stealth

MIT License
245 stars 53 forks source link

Syntax error with args #22

Closed CheemaOTB closed 3 years ago

CheemaOTB commented 3 years ago

when doing this. I am getting a syntax error right after the colon, any idea why? await stealth( page: Page, run_on_insecure_origins: bool = False, languages: [str] = ["en-US", "en"], vendor: str = "Google Inc." user_agent: str = None, locale: str = "en-US,en", mask_linux: bool = True, webgl_vendor: str = "Intel Inc.", renderer: str = "Intel Iris OpenGL Engine", disabled_evasions: list = [], )

mcolella14 commented 3 years ago

This is just the method signature, using type hints. So basically when we define the stealth method and look at the second argument run_on_insecure_origins: bool = False, it is an argument with them name run_on_insecure_origins of the type bool with a default value of False. When implementing this method, you only actually have to pass in the page object, the rest of the arguments you have listed are set to their default values. So just do this instead

await stealth(page)
CheemaOTB commented 3 years ago

That makes sense. Thank you so much, really appreciate it.