Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
  • Loading branch information
kennethreitz committed Feb 27, 2018
1 parent 290cba4 commit c1646dd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions requests_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ async def _async_render(url: str, script: str = None):
# Load the given page (GET request, obviously.)
await page.goto(url)

result = None
if script:
result = await page.evaluate(script)

Expand All @@ -251,12 +250,11 @@ async def _async_render(url: str, script: str = None):

loop = asyncio.get_event_loop()
content = None
result = None

for i in range(retries):
if not content:
try:
content, result = loop.run_until_complete(_async_render(url=self.url))
content, result = loop.run_until_complete(_async_render(url=self.url, script=script))
except TimeoutError:
pass

Expand Down

0 comments on commit c1646dd

Please sign in to comment.