2016年11月18日 星期五

[Crawler] Beginning: Trying urllib.request

method 1: open a File and save it in your current python Folder.
method 2:

type each command

import urllib.request

x = urllib.request.urlopen("http://www.google.com/")

print(x.read())

https://www.youtube.com/watch?v=5GzVNi0oTxQ


2.type line by line as below code
from urllib.request import urlopen
html = urlopen("http://www.google.com/")
print(html)
print(html.read())



http://stackoverflow.com/questions/22676/how-do-i-download-a-file-over-http-using-python

reference:
[book] A Brain-Friendly Guide, Paul Barry && David Griffths
Share:

0 意見:

張貼留言