request

#第三方模块
#1.安装
#软件管理工具pip3

#pip3添加到环境变量
#pip3 install requests


#2、源码安装
#下载代码,安装

#首先得进入到下载的文件夹的目录下,安装命令python setup.py install即可进行安装

import requests

#1.json
#如何安装第三方模块
#request,用于发送http请求的(用Python模拟浏览器浏览网页)
# response= requests.get("https://www.hlbrcbbs.cn:8443/schoolbbs/login.jsp")
# response.encoding="utf-8"
# result=response.text
# print(result)
#使用第三方模块request发送HTTP请求,或则 xml格式内容


#检测qq是否在线
"""r=requests.get('http://www.webxml.com.cn//webservices/qqOnlineWebService.asmx/qqCheckOnline?qqCode=714155624')
result=r.text#字符串类型
from xml.etree import ElementTree as ET
#解析xml格式内容
#xml接受一个参数:字符串,格式化为特殊的对象
node=ET.XML(result)
if node.text=='Y':
print("在线")
else:
print('离线')"""














猜你喜欢

转载自www.cnblogs.com/guozhendong/p/8977347.html