Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom downloader support ShadowDOM #559

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion scraper/src/custom_downloader_middleware.py
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();")
url = self.driver.current_url

return HtmlResponse(
Expand Down