Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

python download html as string

# open-webpage.py

import urllib.request, urllib.error, urllib.parse

url = 'http://www.oldbaileyonline.org/browse.jsp?id=t17800628-33&div=t17800628-33'

response = urllib.request.urlopen(url)
webContent = response.read()

print(webContent[0:300])
Source by programminghistorian.org #
 
PREVIOUS NEXT
Tagged: #python #download #html #string
ADD COMMENT
Topic
Name
8+4 =