Skip to content

Commit 31189f2

Browse files
author
wangxianqiao
committed
Custom downloader support ShadowDOM
1 parent 4267a74 commit 31189f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scraper/src/custom_downloader_middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def process_request(self, request, spider):
2828
self.driver.get(unquote_plus(
2929
request.url)) # Decode url otherwise firefox is not happy. Ex /#%21/ => /#!/%21
3030
time.sleep(spider.js_wait)
31-
body = self.driver.page_source.encode('utf-8')
31+
body = self.driver.execute_script("return document.documentElement.getInnerHTML();")
3232
url = self.driver.current_url
3333

3434
return HtmlResponse(

0 commit comments

Comments
 (0)