爬虫-requests-post
大佬们帮忙看看真的是咋回事啊,,《python3网络爬虫开发实战》52页代码代码:
import requests
data={'name':'germey','age':'25'}
r=requests.post("https:www.,data=data)
print(r.text)
显示错误代码:
Traceback (most recent call last):
File "D:\pythonProject1\爬虫\52.py", line 3, in <module>
r=requests.post("http:www.,data=data)
File "D:\python310\lib\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "D:\python310\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "D:\python310\lib\site-packages\requests\sessions.py", line 573, in request
prep = self.prepare_request(req)
File "D:\python310\lib\site-packages\requests\sessions.py", line 484, in prepare_request
p.prepare(
File "D:\python310\lib\site-packages\requests\models.py", line 368, in prepare
self.prepare_url(url, params)
File "D:\python310\lib\site-packages\requests\models.py", line 445, in prepare_url
raise InvalidURL(f"Invalid URL {url!r}: No host supplied")
requests.exceptions.InvalidURL: Invalid URL 'http:www.': No host supplied