これはウェブページですLINK私は(ペルシア語で)クロールするつもりです。私は次のページボタンをクリックするときに問題があります。Python Seleniumメッセージ:要素が表示されない
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
いくつかの答えが重複したXPathのかもしれませんが、私は、ウェブページのソースにそのようなことを見つけることができなかったと言う:XPathは、私は次のエラーを得たpage.click()
後
nextpage = '//*[@id="ctl00_ContentPlaceHolder1_ASPxSplitter1_CallbackPaneldgd_dgd_DXPagerBottom"]/a[1]/img'
page = driver.find_element_by_xpath(nextpage)
page.click()
です。
完全なコード:
import selenium
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains
driver = webdriver.Chrome(executable_path='./chromedriver')
url = 'http://hmi.mrud.ir/sabaa/SABAA/Home/Default.aspx?strTownship=0101&g=false'
driver.get(url)
time.sleep(10)
nextpage = '//*[@id="ctl00_ContentPlaceHolder1_ASPxSplitter1_CallbackPaneldgd_dgd_DXPagerBottom"]/a[1]/img'
page = driver.find_element_by_xpath(nextpage)
page.click()
感謝。