I try to scrape this site with Python-selenium, my problem is when i launch my script in local it works and i scrape all the articles, but when i launch my script in server, i should run my code Headlessly with Xvfb
display = Display(visible=0, size=(1024, 768))
display.start()
and in this case, the NEXT PAGE button disappear and my script can't click in next page button.
i try to click
xpath_path = 'a.jsNxtPage.pgNext'
try:
element = WebDriverWait(driver, 30).until(EC.presence_of_element_located((By.CSS_SELECTOR, xpath_path)))
finally:
driver.execute_script("arguments[0].click()", element)
it works in local but not when i use Headless Testing in server
i tried also with chrome and firefox.