I was trying to use the new liberary request-html. But when i use the render() function to parse a javascript page, it always pop up with the notes as below:
Error in atexit._run_exitfuncs: Traceback (most recent call last):
File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyppeteer\launcher.py", line 201, in killChrome self._cleanup_tmp_user_data_dir() File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyppeteer\launcher.py", line 130, in _cleanup_tmp_user_data_dir raise IOError('Unable to remove Temporary User Data') OSError: Unable to remove Temporary User Data
I tried to solve the problems, but it seems that there is no solution right now. So i kind of hope someone here can help me.
PS: it seems that i can not post it with the tag:requests-html, i do not have enought repution. So, very sorry for that.
I was trying to use the new liberary request-html. But when i use the render() function to parse a javascript page, it always pop up with the notes as below:
Error in atexit._run_exitfuncs: Traceback (most recent call last):
File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyppeteer\launcher.py", line 201, in killChrome self._cleanup_tmp_user_data_dir() File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyppeteer\launcher.py", line 130, in _cleanup_tmp_user_data_dir raise IOError('Unable to remove Temporary User Data') OSError: Unable to remove Temporary User Data
I tried to solve the problems, but it seems that there is no solution right now. So i kind of hope someone here can help me.
PS: it seems that i can not post it with the tag:requests-html, i do not have enought repution. So, very sorry for that.
Share Improve this question asked Apr 13, 2018 at 4:59 tony.guo140502tony.guo140502 411 silver badge5 bronze badges4 Answers
Reset to default 4I had the same issue, but it seems to have disappeared after my second run. If it keeps happening, perhaps try closing the request
and/or session
after you're done:
session = HTMLSession()
req = session.get(url)
# do something
req.close()
session.close()
I fixed this issue by switch to the administrator mode.
Modify the connection.py file
pyppeteer/connection.py
@@ -41,7 +41,7 @@ def init(self, url: str, loop: asyncio.AbstractEventLoop,
self.connection: CDPSession
self._connected = False
self._ws = websockets.client.connect(
self._url, max_size=None, loop=self._loop)
self._url, max_size=None, loop=self._loop, ping_interval=None, ping_timeout=None)
self._recv_fut = self._loop.create_task(self._recv_loop())
self._closeCallback: Optional[Callable[[], None]] = None
Fixed mine by adding: PYPPETEER_HOME to environment variables on my PC, and the variable value to a folder on my PC, ie; 'C:\tool'
variable name: PYPPETEER_HOME,
variable value: C:\tool
and I had to restart my system.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745153114a4613955.html
评论列表(0条)