Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket
- target_host = 'www.google.com'
- target_port = 80
- client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- client.connect((target_host, target_port))
- client.send('GET / HTTP /1.1rnHost: google.comrnrn')
- response = client.recv(4096)
- print(response);
- Traceback (most recent call last):
- File "dns.py", line 7, in <module>
- client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- AttributeError: module 'socket' has no attribute 'socket'
- Error in sys.excepthook:
- Traceback (most recent call last):
- File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
- from apport.fileutils import likely_packaged, get_recent_crashes
- File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
- from apport.report import Report
- File "/usr/lib/python3/dist-packages/apport/report.py", line 21, in <module>
- from urllib.request import urlopen
- File "/usr/lib/python3.5/urllib/request.py", line 88, in <module>
- import http.client
- File "/usr/lib/python3.5/http/client.py", line 739, in <module>
- class HTTPConnection:
- File "/usr/lib/python3.5/http/client.py", line 749, in HTTPConnection
- def __init__(self, host, port=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
Add Comment
Please, Sign In to add comment