mirror of
https://github.com/zsbai/wechat-versions.git
synced 2026-06-04 07:26:48 +00:00
change to wechat for mac
This commit is contained in:
14
scripts/getVersion.py
Normal file
14
scripts/getVersion.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import lxml
|
||||
import lxml.etree
|
||||
import requests
|
||||
|
||||
|
||||
url = "https://mac.weixin.qq.com/?t=mac&lang=zh_CN"
|
||||
header = {
|
||||
'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36',
|
||||
|
||||
}
|
||||
r = requests.get(url,headers=header).text
|
||||
tree = lxml.etree.HTML(r)
|
||||
version = tree.xpath("/html/body/div/div[2]/div/div[1]/a[1]/div/p[2]/text()")
|
||||
print(version[0])
|
||||
Reference in New Issue
Block a user