Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add pyppeteer_args to .render() #270
Conversation
Fix tests Fix tests
|
A few comments hope we can get it to settle. Thank you for the time making this also the rebase trouble. |
| @@ -4,7 +4,7 @@ python: | |||
|
|
|||
| # command to install dependencies | |||
| install: | |||
| - "pip install pipenv --upgrade-strategy=only-if-needed" | |||
| - "pip install git+https://github.com/pypa/pipenv.git" | |||
oldani
Feb 21, 2019
Member
Pipenv is not actually giving any trouble, so I think we can skip this.
Pipenv is not actually giving any trouble, so I think we can skip this.
| @@ -688,8 +688,7 @@ class BaseSession(requests.Session): | |||
| amongst other things. | |||
| """ | |||
|
|
|||
| def __init__(self, mock_browser : bool = True, verify : bool = True, | |||
| browser_args : list = ['--no-sandbox']): | |||
| def __init__(self, mock_browser : bool = True, verify : bool = True): | |||
oldani
Feb 21, 2019
Member
We should make pyppeteer_args be provided in the Session class rather than when calling render or arender. That way we avoid users thinking this args are per page when under the hood is per session.
We should make pyppeteer_args be provided in the Session class rather than when calling render or arender. That way we avoid users thinking this args are per page when under the hood is per session.
| def response_hook(self, response, **kwargs) -> HTMLResponse: | ||
| """ Change response enconding and replace it by a HTMLResponse. """ | ||
| if not response.encoding: | ||
| response.encoding = DEFAULT_ENCODING | ||
| return HTMLResponse._from_response(response, self) | ||
|
|
||
| @property | ||
| async def browser(self): | ||
| async def get_browser(self, pyppeteer_args=None): |
oldani
Feb 21, 2019
Member
If pyppeteer_args are provided on Session initialization, we can keep browser being a property.
If pyppeteer_args are provided on Session initialization, we can keep browser being a property.
|
@scythargon Any updates here? I want to merge this |
|
@scythargon I really want to get this merged, are you still on this? I can finish this but I can figure a way to give your credits due to this. |
|
merge conflict |
|
It would be nice if this pull request could be sorted out because its quite a breaking feature for raspberry pi / Linux devices. It seems like i found a fix here: miyakogi/pyppeteer#250 (comment) |
|
@oldani @scythargon any movement on this? I know y'all are probably super busy but it would be extraordinarily helpful to get these changes merged in. |
|
If I'm reading this properly, all that needs to be done is undoing the changes to the |
Why --- - Developers need the ability to set all of the pyppeteer args when instantiating a session. This way they can set their own executable path when running in a container, RaspberryPi, etc. How --- - Add pyppeteer args as a dict to the BaseSession init method. - Use the browser args and pyppeteer args to launch pyppeteer. Related PRs ----------- - psf#270
Rebased my previous PR #166 into another branch.