Recently,I make an app and upload it to my GitHub release page.I want to make a function to check update to get the latest version(in the release pages).
I try to use requests module to crawl my release page to get the latest version.Here it a minimal example of my code:
import requests
from lxml import etree
response = requests.get("https://github.com/v2ray/v2ray-core/releases")
html = etree.HTML(response.text)
Version = html.xpath("/html/body/div[4]/div/main/div[3]/div/div[2]/div[1]/div/div[2]/div[1]/div/div/a")
print(Version)
I think the xpath is right,because I use chrome -> copy -> copy xpath.But it return me a [].it can't find the latest version.