|
|
楼主 |
发表于 2020-7-28 17:18:33
|
显示全部楼层
|
免费节点的源代码
import requests
import time
from lxml import etree
headers={'Host': '8.2452.xyz',
'Proxy-Connection': 'keep-alive',
'Cache-Control': 'max-age=0',
'Upgrade-Insecure-Requests': '1',
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) ',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
'Referer': 'http://8.2452.xyz/user',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8',
}
#data={'email':'[email protected]','name':'qmmju','passwd':'qweasd123','repasswd':'qweasd123','code':'0'}
#print(headers)
#url='http://8.2452.xyz/auth/register'
'''res=requests.post(url,data)
print(res.cookies,res.url)
with open('b111.html','a+',encoding='utf-8')as f:
f.write(res.text)
print(res.status_code)'''
def resiger(n):
for i in range(n):
url='http://8.2452.xyz/auth/register'
data={'email':'[email protected]','name':'qmmju','passwd':'qweasd123','repasswd':'qweasd123','code':'0'}
t=str(time.time())
data['email']=t+'@qq.com'
res=requests.post(url,data)
del data['repasswd']
del data['name']
data['code']=''
print(data)
#html=etree.HTML(res.text)
url='http://8.2452.xyz/auth/login'
res=requests.post(url,data)
cookies=res.cookies.get_dict()
url='http://8.2452.xyz/user/node'
res=requests.get(url,cookies=cookies)
html=etree.HTML(res.text)
v1=html.xpath('//*[@id="node-modal-3"]/div/div/div[2]/div[8]/code/text()')[0]
v2=html.xpath('//*[@id="node-modal-8"]/div/div/div[2]/div[8]/code/text()')[0]
with open('vemss.txt','a+',encoding='utf-8')as f:
f.write(v1)
f.write('\n')
f.write(v2)
f.write('\n')
resiger(10) |
|