Skip to content

Commit

Permalink
Merge branch 'master' into verify-parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pigna90 authored Sep 19, 2018
2 parents f4d9de9 + 004a9b6 commit 8c6b3b3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions requests_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ def render(self, retries: int = 8, script: str = None, wait: float = 0.2, scroll
if self.url == DEFAULT_URL:
reload = False


for i in range(retries):
if not content:
try:
Expand Down Expand Up @@ -698,6 +699,9 @@ def __init__(self, mock_browser : bool = True, verify : bool = False,
self.hooks['response'].append(self.response_hook)
self.verify = verify

self.__browser_args = browser_args


def response_hook(self, response, **kwargs) -> HTMLResponse:
""" Change response enconding and replace it by a HTMLResponse. """
if not response.encoding:
Expand All @@ -708,6 +712,7 @@ def response_hook(self, response, **kwargs) -> HTMLResponse:
async def browser(self):
if not hasattr(self, "_browser"):
self._browser = await pyppeteer.launch(ignoreHTTPSErrors=not(self.verify), headless=True, args=self.__browser_args)

return self._browser


Expand Down

0 comments on commit 8c6b3b3

Please sign in to comment.