var launchOptions = new LaunchOptions { Headless = false, DefaultViewport = null, IgnoreHTTPSErrors = true, ExecutablePath = path + "\\.local-chromium\\chrome-win\\chrome.exe", Args = new string[] { "--no-sandbox", "--start-maximized", "--window-size=800,800", "--disable-setuid-sandbox", "--disable-accelerated-2d-canvas", "--no-zygote", "--renderer-process-limit=1", "--no-first-run", "--ignore-certificate-errors", "--ignore-certificate-errors-spki-list", "--disable-dev-shm-usage", "--disable-infobars", "--disable-extensions", "--disable-web-security", "--disable-blink-features=AutomationControlled", // 重点就是这行代码, 让自动化不可见 //"--user-agent=Mozilla/5.0" //"--user-agent=Mozilla/5.0(Windows NT 10.0; Win64; x64)AppleWebKit/537.36(KHTML,like Gecko)Chrome/58.0.3029.110 Safari/537.36" "--user-agent=\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36\"" // 设置头, 不设置也可以 // } };
"--disable-blink-features=AutomationControlled",
------------- ------------- -------------------------- -------------
以下代码为js拖动
event = document.createEvent('MouseEvents'); event.initEvent('mousedown', true, false); document.querySelector("#nc_1_n1z").dispatchEvent(event); event = document.createEvent('MouseEvents'); event.initEvent('mousemove', true, false); Object.defineProperty(event,'clientX',{get(){return 260;}}) document.querySelector("#nc_1_n1z").dispatchEvent(event);
实现模拟拖动
标签:拖动,Puppeteersharp,顺带,js,--,537.36,disable,document,event From: https://www.cnblogs.com/aashui/p/18048659