最近在用selenium开发爬虫,爬取网站就是51job,在爬虫时,总会在翻页后就遇到这类错误:StaleElementReferenceException:Message:staleelementreference:elementisnotattachedtothepagedocument总之,就是这个StaleElementReferenceException,差点给我搞崩溃了。因为这个错误其实并不难理解,Stale就是“过期的、失效的、坏掉的”意思,而这个错误也说的很明确,当前你使用的这个seleniumelement,并未attach到网页上,是个错误的element下面,我就讲讲我的