第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

request問題-為什么出現(xiàn)這個問題


import urllib.request

req = request.Requst("http://www.baidu.com")

req.add_header("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Safari/537.36")

resp = request.urlopen(req)


print(resp.read().decode("utf-8"))

報錯


Traceback (most recent call last):

? File "C:\a spider enviroment\study file\try.py", line 3, in <module>

? ? req = request.Requst("http://www.baidu.com")

NameError: name 'request' is not defined

[Finished in 0.5s with exit code 1]

[shell_cmd: python -u "C:\a spider enviroment\study file\try.py"]

[dir: C:\a spider enviroment\study file]

[path: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\BlueStone\Anaconda3;C:\Users\BlueStone\Anaconda3\Library\mingw-w64\bin;C:\Users\BlueStone\Anaconda3\Library\usr\bin;C:\Users\BlueStone\Anaconda3\Library\bin;C:\Users\BlueStone\Anaconda3\Scripts;C:\Users\BlueStone\AppData\Local\Microsoft\WindowsApps]


正在回答

1 回答

request?=?urllib.request.Request(url)
改成這樣試試


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

request問題-為什么出現(xiàn)這個問題

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號