Merge branch 'master' of http://210.77.77.77/xieshen/newmediamonitoring
This commit is contained in:
commit
39635defd4
|
@ -97,8 +97,13 @@ def parse(url):
|
|||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
|
||||
}
|
||||
r = requests.get(url, headers=headers)
|
||||
r.encoding = 'utf-8'
|
||||
print(r.text)
|
||||
print(r.encoding)
|
||||
|
||||
if t == 'xgs' and r.encoding=='ISO-8859-1':
|
||||
r.encoding='GBK'
|
||||
else:
|
||||
r.encoding = 'utf-8'
|
||||
# way2@8797799
|
||||
selector = Selector(text=r.text)
|
||||
if t == 'weixin':
|
||||
og_title = selector.xpath(
|
||||
|
@ -162,10 +167,10 @@ if __name__ == '__main__':
|
|||
# 'https://m.toutiao.com/i6883651337003729420/?tt_from=weixin&utm_campaign=client_share&app=news_article&utm_source=weixin&iid=1494959660475024&utm_medium=toutiao_android&wxshare_count=1')
|
||||
# og_title, og_description, og_url, og_image = parse(
|
||||
# 'http://www.gov.cn/xinwen/2020-10/13/content_5550906.htm')
|
||||
# og_title, og_description, og_url, og_image = parse(
|
||||
# 'http://xgs.gansudaily.com.cn/pages/h5/hot/b3297046a53e47f594ed19db90c1183c.html')
|
||||
og_title, og_description, og_url, og_image = parse(
|
||||
'http://gansu.gansudaily.com.cn/system/2021/01/25/030261998.shtml')
|
||||
|
||||
# print(og_title, og_description, og_url, og_image)
|
||||
print(og_title, og_description, og_url, og_image)
|
||||
# print(send_voice_notify('13993199566'))
|
||||
r = send_tnps(['13609346975'], '')
|
||||
print(r.status_code, r.text)
|
||||
# r = send_tnps(['13609346975'], '')
|
||||
# print(r.status_code, r.text)
|
||||
|
|
Loading…
Reference in New Issue