国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

已解決selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds

這篇具有很好參考價值的文章主要介紹了已解決selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

已解決selenium操作瀏覽器拖動滑塊,拋出異常selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds的正確解決方法,親測有效?。?!









報錯問題



在下面的代碼中,首先通過find_element方法找到驗證碼橫向滑塊的元素,然后通過ActionChains模塊模擬鼠標(biāo)點擊和拖動。整個滑塊的運動軌跡被存儲在列表track中,先加速后減速。其中,加速和減速的軌跡模擬的是勻加速和勻減速的情形,而勻速的軌跡通過在加速的基礎(chǔ)上保持一段距離實現(xiàn)。最后,依據(jù)軌跡拖動滑塊,并等待驗證碼驗證結(jié)果:

from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
import time


driver = webdriver.Chrome()

url = 'https://www.some-website.com'
driver.get(url)

slider = driver.find_element(by=By.ID, value="nc_1_n1z")
ActionChains(driver).click_and_hold(slider).perform()

distance = 300 # 橫向滑塊需要移動的距離

ActionChains(driver).move_by_offset(distance , 0).perform()

time.sleep(1) # 等待驗證碼驗證結(jié)果

driver.quit()

報錯信息截圖內(nèi)容如下所示


已解決selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds





報錯翻譯



報錯信息內(nèi)容翻譯如下所示


selenium.com.mon.異常.移動目標(biāo)超出范圍異常:消息:將目標(biāo)移出邊界。





報錯原因



報錯原因

selenium拖動鼠標(biāo)網(wǎng)頁標(biāo)簽的超出范圍,所以報錯報錯。

小伙伴們按下面的方法設(shè)置合作的拖動距離即可?。。?/mark>




解決方法



比如滑塊如下,那么拖動距離就是紅框的長度,用截圖測算拖動的即可即可:

已解決selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds

在修改那移動的距離即可:

distance = 300  # 橫向滑塊需要移動的距離

以上是此問題報錯原因的解決方法,歡迎評論區(qū)留言討論是否能解決,如果有用歡迎點贊收藏文章謝謝支持,博主才有動力持續(xù)記錄遇到的問題?。。?/strong>

千人全棧VIP答疑群聯(lián)系博主幫忙解決報錯

由于博主時間精力有限,每天私信人數(shù)太多,沒辦法每個粉絲都及時回復(fù),所以優(yōu)先回復(fù)VIP粉絲,可以通過訂閱限時9.9付費專欄《100天精通Python從入門到就業(yè)》進入千人全棧VIP答疑群,獲得優(yōu)先解答機會(代碼指導(dǎo)、遠(yuǎn)程服務(wù)),白嫖80G學(xué)習(xí)資料大禮包,專欄訂閱地址:https://blog.csdn.net/yuan2019035055/category_11466020.html

  • 優(yōu)點作者優(yōu)先解答機會(代碼指導(dǎo)、遠(yuǎn)程服務(wù)),群里大佬眾多可以抱團取暖(大廠內(nèi)推機會),此專欄文章是專門針對零基礎(chǔ)和需要進階提升的同學(xué)所準(zhǔn)備的一套完整教學(xué),從0到100的不斷進階深入,后續(xù)還有實戰(zhàn)項目,輕松應(yīng)對面試!

  • 專欄福利簡歷指導(dǎo)、招聘內(nèi)推、每周送實體書、80G全棧學(xué)習(xí)視頻、300本IT電子書:Python、Java、前端、大數(shù)據(jù)、數(shù)據(jù)庫、算法、爬蟲、數(shù)據(jù)分析、機器學(xué)習(xí)、面試題庫等等

  • 注意:如果希望得到及時回復(fù),和大佬們交流學(xué)習(xí),訂閱專欄后私信博主進千人VIP答疑群已解決selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds
    已解決selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds

免費資料獲取,更多粉絲福利,關(guān)注下方公眾號獲取

已解決selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds文章來源地址http://www.zghlxwxcb.cn/news/detail-416902.html

到了這里,關(guān)于已解決selenium.common.exceptions.MoveTargetOutOfBoundsException: Message: move target out of bounds的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 解決selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted

    用selenium爬數(shù)據(jù)的時候,明明每一步點擊都加了WebDriverWait,但還是爬一會兒就顯示如下錯誤: 這里一定要注意后面的這句 也就是說我們想點擊的按鈕沒點成,而是被這個覆蓋了。 查資料得知: blockUI 是一個 JavaScript 庫,用于創(chuàng)建可定制的頁面遮罩和加載指示器。它提供了一

    2024年02月11日
    瀏覽(24)
  • 已解決selenium.common.exceptions.WebDriverException: Message: invalid session id

    已解決selenium.common.exceptions.WebDriverException: Message: invalid session id

    已解決selenium循環(huán)翻頁拋出selenium.common.exceptions.WebDriverException: Message: invalid session id的正確解決方法,親測有效!??! 粉絲群里面的一個小伙伴遇到問題跑來私信我,想用selenium循環(huán)翻頁,但是發(fā)生了報錯(當(dāng)時他心里瞬間涼了一大截,跑來找我求助,然后順利幫助他解決了,

    2023年04月08日
    瀏覽(27)
  • 解決selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable報錯

    這個錯誤是由Selenium WebDriver引起的,它表示一個元素?zé)o法與之交互。 這通常意味著Selenium無法模擬用戶與該元素交互的方式,可能是由于以下原因之一: 元素被隱藏了,無法與之交互。 元素被覆蓋了,無法與之交互。 元素不可見,無法與之交互。 頁面還沒有完全加載,元素

    2024年02月14日
    瀏覽(26)
  • selenium.common.exceptions.WebDriverException: Message: chrome not reachable解決方法

    在 python上使用 selenium 。 一開始還算順利,但是隨著反復(fù)執(zhí)行,處理量變多了。 如果一直等待,最終會出現(xiàn)無法訪問 chrome 的錯誤。 已經(jīng)添加了driver.quit()。 引入一個新的函數(shù),檢查是否有 chrome 驅(qū)動程序正在運行,并打印提示,如果有,則殺死所有chrome 驅(qū)動程序。 相當(dāng)于在

    2024年02月16日
    瀏覽(17)
  • 已解決selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted:

    已解決selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted:

    已解決python selenium模塊自動化操作瀏覽器點擊元素,拋出異常selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element的正確解決方法,親測有效?。?一個小伙伴遇到問題跑來私信我, 想用python selenium模塊自動化操作瀏覽器點擊元素,點擊下一頁翻頁爬

    2023年04月24日
    瀏覽(25)
  • 一文解決:selenium.common.exceptions.SessionNotCreatedException: Message: session not created

    一文解決:selenium.common.exceptions.SessionNotCreatedException: Message: session not created

    你遇到的錯誤消息表明您正在使用的ChromeDriver的版本與您計算機上安裝的Google Chrome版本不兼容。ChromeDriver是一個獨立的可執(zhí)行文件,WebDriver使用它來控制Chrome瀏覽器。要解決這個問題,您有幾個可能的解決方案,具體介紹如下所示。 1.修改ChromeDriver的版本 此方法需要首先查

    2024年02月08日
    瀏覽(27)
  • selenium.common.exceptions.SessionNotCreatedException: Message: session not created 解決辦法

    selenium.common.exceptions.SessionNotCreatedException: Message: session not created 解決辦法

    一、問題原因 報這個錯是因為 當(dāng)前瀏覽器的版本與 chromedriver.exe的版本不一致了。這個時候你需要先知道自己當(dāng)前瀏覽器的版本 ,然后再去下載一個 chromedriver.exe的對應(yīng)版就好了 二、解決辦法 1、查看瀏覽器版本 幫助-關(guān)于Google Chrome https://registry.npmmirror.com/binary.html?path=chro

    2024年02月11日
    瀏覽(22)
  • 【python selenium報錯】selenium.common.exceptions.WebDriverException: Message: <html> 三種解決方案!

    【python selenium報錯】selenium.common.exceptions.WebDriverException: Message: <html> 三種解決方案!

    在運行python代碼時遇到該問題解決方案三種(我是第三種才解決的,總結(jié)一句話:是代理ip的問題★★★): 一、重新安裝selenium,可能是缺少某些文件 二、查看chrom的版本,在chrom驅(qū)動的官方網(wǎng)站中下載安裝適配的版本(版本接近即可),并將其配置到系統(tǒng)環(huán)境下,具體步驟

    2024年02月11日
    瀏覽(39)
  • selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id 報錯解決方法

    selenium.common.exceptions.InvalidSessionIdException: Message: invalid session id 報錯解決方法

    原因是在使用webdriver之前調(diào)用了 close_driver() 將webdriver關(guān)閉了,則webdriver就失效了。 在使用selenium進行自動獲取信息時,報錯:InvalidSessionIdException: Message: invalid session id 因為我需要獲取多個頁面的數(shù)據(jù),讓他自動進入下一頁獲取信息,但是我卻在讓他在第一頁完了后就關(guān)閉了

    2024年02月11日
    瀏覽(21)
  • 已解決selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain: Cookie ‘

    已解決selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain: Cookie ‘

    已解決selenium.common.exceptions.InvalidCookieDomainException: Message: invalid cookie domain: Cookie ‘domain’ mismatch 粉絲群里面的一個小伙伴遇到問題跑來私信我,想用selenium攜帶cookie登錄網(wǎng)站,但是發(fā)生了報錯(當(dāng)時他心里瞬間涼了一大截,跑來找我求助,然后順利幫助他解決了,順便記錄一

    2024年02月07日
    瀏覽(18)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包