1:得到key,形成RAW下GET 【包含了设置代理,888端口安装证书】
2:运行a程序,调用chrome浏览器,模拟下滑动态取数,数据保存HTML 【SELENIUM技术】
3:运行b程序,调用HTML数据,保存到数据库
4:微信图片显示:
以下列举几种方法:
- http://read.html5.qq.com/image?src=forum&q=5&r=0&imgflag=7&imageUrl=防盗链图片地址
- http://img2.haokoo.com/getImg.php?url=防盗链图片地址
- http://img.wtoutiao.com/?url=防盗链图片地址
5:py3.x 调用webservice
直接使用命令行:pip install suds
报错:Traceback (most recent call last):
File "setup.py", line 20, in <module>
import suds
File "/root/python-suds-0.4.1/suds/__init__.py", line 154, in <module>
import client
ImportError: No module named client
后来从网上看到了解决方案,说官网已经用另外一个库替代了这个库
pip install suds-jurko
import suds
from suds.client import Client
url = "http://localhost/Service1?wsdl"
client = suds.client.Client(url)
#getHealthyHeBei是webService提供的方法
result = client.service.gethello("test")
#打印出结果
print(result)
另外一段参考:
def InvokeWebservice(phone,msg):
texturl='http://127.0.0.1:7789/SMSService.asmx?op=SendShortMessage'
postcontent='<?xml version="1.0" encoding="utf-8"?>'
postcontent+='<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
postcontent+='<soap:Body>'
postcontent+='<SendShortMessage xmlns="http://tempuri.org/">'
postcontent+='<phonenum>'+phone+'</phonenum>'#参数
postcontent+='<message>'+msg+'</message>'#参数
postcontent+='</SendShortMessage>'
postcontent+='</soap:Body>'
postcontent+='</soap:Envelope>'
req=urllib.request.Request(texturl,data=postcontent.encode('utf-8'),headers={'Content-Type': 'text/xml'})
urllib.request.urlopen(req)
附上建表:
DROP TABLE IF EXISTS `zwxitgpost`;标签:COMMENT,varchar,webservice,DEFAULT,微信,py3,suds,postcontent,NULL From: https://blog.51cto.com/u_512327/5933807
CREATE TABLE `zwxitgpost` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`biz` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '文章对应的公众号biz',
`field_id` varchar(30) DEFAULT NULL COMMENT '微信定义的一个id,每条文章唯一',
`ztitle` varchar(255) DEFAULT '' COMMENT '文章标题',
`title_encode` text CHARACTER SET utf8 COMMENT '文章编码,防止文章出现emoji',
`zdesc` varchar(500) DEFAULT '' COMMENT '文章摘要',
`zhref` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT '文章地址',
`source_url` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT '阅读原文地址',
`zimg` varchar(500) CHARACTER SET utf8 DEFAULT NULL COMMENT '封面图片',
`is_multi` int(11) DEFAULT NULL COMMENT '是否多图文',
`is_top` int(11) DEFAULT NULL COMMENT '是否头条',
`ztime` date DEFAULT NULL,
`readNum` int(11) DEFAULT '1' COMMENT '文章阅读量',
`likeNum` int(11) DEFAULT '0' COMMENT '文章点赞量',
`zcontent` text CHARACTER SET utf8,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=gbk;