import urllib.request
import urllib.parse

def get(urlStr,params={}):
    if params == {}:
        req = urllib.request.urlopen(urlStr)
    else:
        reqdata = urllib.request.Request(urlStr,urllib.parse.urlencode(params).encode('ascii'))
    req = urllib.request.urlopen(reqdata)
    return req.read()

@@ -71,36 +71,15 @@
     
-if params == %7B%7D:%0A        req
+reqdata
  = u
@@ -92,23 +92,23 @@
 request.
-urlopen
+Request
 (urlStr)
@@ -116,62 +116,164 @@
     
-else:%0A        reqdata = urllib.request.Request(urlStr,
+reqdata.add_header('User-Agent',%0A                       'VocabTool/0.2 (https://github.com/RihanWu/vocabtool)')%0A    if params != %7B%7D:%0A        reqdata.data = 
 urll
@@ -314,17 +314,16 @@
 'ascii')
-)
 %0A    req

Add User-Agent for better netiquette