利用爬虫去除acg视频软件广告

之前的发布的那个使用后发现id会变,重新弄了个爬虫能自动更新的

from lxml import etree
import win32com.client as wc
import requests

headers = {
    'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36 Edg/90.0.818.46",
}
url = 'https://www.axilesoft.com/app/player/lib/?hideadonce=acg&lang=cn'
responce = requests.get(url,headers = headers)
text = responce.text
html = etree.HTML(text)
acg = html.xpath('//*[@id="haButton"]/@onclick')
print(acg)
acgdata = acg[0].split("'")
data = acgdata[1]
wsh = wc.Dispatch("WScript.Shell")
wsh.Run(data)

上一篇:yum命令常用参数总结


下一篇:urllib.request.Request hearders首字母不能小写的问题: