urllib - python can't read website html code -


i can't read html code of website using urllib

def tests(url):  	response = urllib.urlopen(url)  	soup = beautifulsoup(response.read())  	universities=soup.findall('a',{'class':'pin-link'})  	print universities    if __name__ == '__main__':  	tests("https://pinshape.com/shop?page=3&is-free=true&type=-streamable")
possible read page source ?

you try using urllib.request. taking snippet of part of code using, works follows

import urllib.request urllib.request.urlopen('https://pinshape.com/shop?page=2') f:    data = str(f.read()).replace('\n', '')  myfile = open("testfile.txt", "r+") myfile.write(data) 

Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -