1

I am trying to move to page 2 and beyond of this page (pagination) with python selenium and spent a few hours on this. I am getting this error, and would be thankful of any help..Error from chromedriver

is not clickable at point(). Other element would receive the click

My code so far:

class Chezacash:
    t1 = time.time()
    driver = webdriver.Chrome(chromedriver)


    def controller(self):
        self.driver.get("https://www.chezacash.com/#/home/")
        element = WebDriverWait(self.driver, 10).until(
        EC.presence_of_element_located((By.CSS_SELECTOR, "div.panel-heading")))    
        soup = BeautifulSoup(self.driver.page_source.encode('utf-8'),"html.parser")
        self.parser(soup)
        self.driver.find_element(By.XPATH, "//li[@class='paginate_button active']/following-sibling::li").click()
        time.sleep(2)
        soup = BeautifulSoup(self.driver.page_source.encode('utf-8'),"html.parser")
        self.parser(soup)


    def parser(self, soup):
        for i in soup.find("table", {"id":"DataTables_Table_1"}).tbody.contents:
            date =  i.findAll("td")[0].get_text().strip()
            time =  i.findAll("td")[1].get_text().strip()
            home =   i.findAll("td")[4].div.span.get_text().strip().encode("utf-8")
            home_odds =  i.findAll("td")[4].div.findAll("span")[1].get_text().strip()
            draw_odds =  i.findAll("td")[5].div.findAll("span")[1].get_text().strip()
            away =   i.findAll("td")[6].div.span.get_text().strip().encode("utf-8")
            away_odds =  i.findAll("td")[6].div.findAll("span")[1].get_text().strip()
            print home

cheza = Chezacash()
try:
    cheza.controller()
except:
    cheza.driver.service.process.send_signal(signal.SIGTERM) # kill the specific phantomjs child proc                            # quit the node proc
    cheza.driver.quit()
    traceback.print_exc()
1
  • 1
    A quick comment on your code. In the for i loop, the first line should store i.findAll("td") in a variable and then date and so on would access the different [0], etc. elements. Your current code is rescraping the page (.findAll()) for each assigned variable. Commented Mar 25, 2017 at 1:20

1 Answer 1

2

What if instead you would locate the "Next" button by link text, scroll into it's view and then click:

next_button = self.driver.find_element_by_link_text("Next")
self.driver.execute_script("arguments[0].scrollIntoView();", next_button)
next_button.click()

I would also maximize the browser window before navigating to the page:

self.driver.maximize_window()
self.driver.get("https://www.chezacash.com/#/home/")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.