selenium定位时报错:
selenium.common.exceptions.ElementClickInterceptedException: Message: Element <span class="pager_next "> is not clickable at point (635,697) because another element <div class="foot-fix-ad-container-background"> obscures it
这是一种反爬机制,当要点击的按钮不在视野范围内时,就定位不到元素,所以需要移动滚动条,把要定位的元素显示在屏幕上。使用selenium执行js语句:
driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")