You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error that I got:
'''
(CJ_test) kirancj@Home AcceptTransfer % python3 original_at.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/encodings/idna.py", line 165, in encode
raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "original_at.py", line 27, in
asyncio.get_event_loop().run_until_complete(connect_to_scraping_browser())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "original_at.py", line 21, in connect_to_scraping_browser
browser = await pyppeteer.connect({
File "/Users/kirancj/.local/share/virtualenvs/CJ_test-RO4vW2LI/lib/python3.8/site-packages/pyppeteer/launcher.py", line 350, in connect
browserWSEndpoint = get_ws_endpoint(browserURL)
File "/Users/kirancj/.local/share/virtualenvs/CJ_test-RO4vW2LI/lib/python3.8/site-packages/pyppeteer/launcher.py", line 229, in get_ws_endpoint
with urlopen(url) as f:
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1383, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1354, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1298, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1247, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1007, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 947, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 918, in connect
self.sock = self._create_connection(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
'''
python version - 3.8
pyppeteer version - 1.0.2
Sample code that I used:
async def connect_to_scraping_browser():
hostname = input("Enter the hostname: ")
username = input("Enter the username: ")
password = input("Enter the password: ")
try:
idna.encode(hostname)
except idna.IDNAError:
print("The hostname is invalid.")
return
browser = await pyppeteer.connect({
"browserURL": f"http://{username}:{password}@{hostname}:9222/json"
})
The error that I got:
'''
(CJ_test) kirancj@Home AcceptTransfer % python3 original_at.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/encodings/idna.py", line 165, in encode
raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "original_at.py", line 27, in
asyncio.get_event_loop().run_until_complete(connect_to_scraping_browser())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "original_at.py", line 21, in connect_to_scraping_browser
browser = await pyppeteer.connect({
File "/Users/kirancj/.local/share/virtualenvs/CJ_test-RO4vW2LI/lib/python3.8/site-packages/pyppeteer/launcher.py", line 350, in connect
browserWSEndpoint = get_ws_endpoint(browserURL)
File "/Users/kirancj/.local/share/virtualenvs/CJ_test-RO4vW2LI/lib/python3.8/site-packages/pyppeteer/launcher.py", line 229, in get_ws_endpoint
with urlopen(url) as f:
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1383, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1354, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1298, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1247, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1007, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 947, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 918, in connect
self.sock = self._create_connection(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 787, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
'''
python version - 3.8
pyppeteer version - 1.0.2
Sample code that I used:
async def connect_to_scraping_browser():
hostname = input("Enter the hostname: ")
username = input("Enter the username: ")
password = input("Enter the password: ")
try:
idna.encode(hostname)
except idna.IDNAError:
print("The hostname is invalid.")
return
browser = await pyppeteer.connect({
"browserURL": f"http://{username}:{password}@{hostname}:9222/json"
})
asyncio.get_event_loop().run_until_complete(connect_to_scraping_browser())
hostname entered is " brd.superproxy.io "
The text was updated successfully, but these errors were encountered: