This blog contains notes from different learning sites. This notes falls in Information Security, Cyber Security, Network Security and other Security Domain class. Any suggestion to make this site helpful is truly welcome :)
1 x = urllib.request.urlopen('http://data.pr4e.org/romeo.txt')
1 2 3 4 5 6 7 8 9 10 11 12 13 import socket mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) mysock.connect(('data.pr4e.org', 80)) cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\n\n'.encode() mysock.send(cmd) while True: data = mysock.recv(512) if (len(data) < 1): break print(data.decode()) mysock.close()
1 <p>Please click <a href="http://www.dr-chuck.com">here</a></p>
1 2 3 html = urllib.request.urlopen(url).read() soup = BeautifulSoup(html, 'html.parser') x = soup('a')
No comments:
Post a Comment