Skip to content

Commit

Permalink
Custom downloader support ShadowDOM
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxianqiao committed Sep 3, 2021
1 parent 4267a74 commit 50ab814
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scraper/src/custom_downloader_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def process_request(self, request, spider):
self.driver.get(unquote_plus(
request.url)) # Decode url otherwise firefox is not happy. Ex /#%21/ => /#!/%21
time.sleep(spider.js_wait)
body = self.driver.page_source.encode('utf-8')
body = self.driver.execute_script("return document.documentElement.getInnerHTML ? document.documentElement.getInnerHTML() : document.documentElement.outerHTML;")
url = self.driver.current_url

return HtmlResponse(
Expand Down

0 comments on commit 50ab814

Please sign in to comment.