Python urllib cache

前端 未结 2 1438
春和景丽
春和景丽 2021-01-28 16:43

I\'m writing a script in Python that should determine if it has internet access.

import urllib

CHECK_PAGE     = \"http://64.37.51.146/check.txt\"
CHECK_VALUE            


        
2条回答
  •  南方客
    南方客 (楼主)
    2021-01-28 17:25

    You want

    page = urllib.urlopen(CHECK_PAGE, proxies={})
    

    Remove the

    urllib.getproxies = lambda x = None: {}
    

    line.

提交回复
热议问题