import asyncio
from pyppeteer import launch
width, height = 2000, 1000
async def main():
browser = await launch(headless=False, userDataDir='./userdata', args=[f'--window-size={width},{height}', '--disable-infobars'])
page = await browser.newPage()
await page.setViewport({'width': width, 'height': height})
await page.goto('https://login.taobao.com/member/login.jhtml?redirectURL=https://www.taobao.com/')
await page.evaluate('''() =>{ Object.defineProperties(navigator,{ webdriver:{ get: () => false } }) }''')
await asyncio.sleep(100)
asyncio.get_event_loop().run_until_complete(main())
来源:https://blog.csdn.net/zlf19910726/article/details/102777866