web crawling(plus1)

urllib.request.rechieve("www",filename="")

urllib.request.cleanup()

a=urllib.request.urlopen()   

a.info()

a.getcode()

a.geturl()

*******************************************

a=urllib.request.urlopen("https://www.galaxymacau.com/zh-hant/",timeout=200)
***********************************
for i in range(0,100):
try:
a=urllib.request.urlopen("https://www.galaxymacau.com/zh-hant/",timeout=1)
data1=a.read()
print(len(data1))
except Exception as e:
print("exception now:"+str(e))
**********************************
http request:

posted @ 2017-10-02 13:10  兔子的尾巴_Mini  阅读(238)  评论(0)    收藏  举报