1 Star 0 Fork 45

shenge08/qytang_Python

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
2016.1.10. 伪装Firefox游览器 375 Bytes
Copy Edit Raw Blame History
import urllib.request
BROWSER = 'Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0'
URL = 'http://www.cisco.com'
def spoof_firefox():
opener = urllib.request.build_opener()
opener.addheaders = [('User-agent', BROWSER)]
result = opener.open(URL)
print("Response headers:")
print(result.headers)
if __name__ == '__main__':
spoof_firefox()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/shenge08/qytang_Python.git
git@gitee.com:shenge08/qytang_Python.git
shenge08
qytang_Python
qytang_Python
master

Search