I want to refresh the page once at a time, but now it"s time to grab the last refreshed page after performing the refresh
class JavaScriptMiddleware (object):
@classmethod
def process_request(cls, request, spider):
for i in range(3):
driver = webdriver.PhantomJS()
sleep(3)
driver.get(request.url)
body = driver.page_source
driver.quit()
return HtmlResponse(request.url, encoding="utf-8", body=body, request=request)