playwright 隐藏webdrive
- 编程
- 2021-05-13
- 2242
from playwright.sync_api import sync_playwright import time with sync_playwright() as p: browser = p.chromium.launch(headless=False) page = browser.new_page() page.add_init_script(path='D:\Python37\Scripts\stealth.min.js') # 加载JS文件 防止被检测到 page.goto("https://bot.sannysoft.com/") time.sleep(3) page.screenshot(path='scree.jpg') browser.close()
发表评论