看板 Python 關於我們 聯絡資訊
小弟要擷取網頁上的某個區塊 使用 mobileEmulation = {"deviceName": "iPhone 6 Plus"} options = webdriver.ChromeOptions() options.add_experimental_option('mobileEmulation', mobileEmulation) options.add_argument('--log-level=3') options.add_argument('–no-sandbox') driver = webdriver.Chrome(chrome_options=options, executable_path='C:\\chromedriver.exe') driver.get(url) driver.save_screenshot(path) 但是在抓的時候他會閃一下 抓出來的圖就跟原來的解析度不太一樣 導致我後來要用 im = im.crop((left, top, right, bottom)) 的時候 無法抓到正確的位置 不知道有沒有先進有遇過類似問題 是怎麼解決的呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 118.171.100.19 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/Python/M.1594803376.A.DD0.html