|
|

楼主 |
发表于 2020-8-1 17:20:51
|
显示全部楼层
|
- import time
- import json
- from lxml import etree
- from concurrent import futures
- import requests
- from rname import mutiname
- ls=[]
- headers={'User-Agent':'Mozilla/5.0 baocaoxz',}
- def one(name):
- session=requests.session()
- url='https://19se.cc/auth/register'
- t=time.time()
- em=name+str(t)[15:]
- email=em+'@qq.com'
- print('email:%s'%email)
- data={
- 'email': email,
- 'name': 'baocaowxy',
- 'passwd': 'qdjsodnbdiie783',
- 'repasswd': 'qdjsodnbdiie783',
- 'code': 'P2lc',
- }
- session.post(url,data=data)
- url='https://19se.cc/auth/login'
- data={
- 'email': email,
- 'passwd': 'qdjsodnbdiie783',
- 'code': '',
- 'remember_me': '1'
- }
- session.post(url,data)
- url='https://19se.cc/user/buy'
- data={
- 'coupon':'',
- 'shop': '18',
- 'autorenew': '0',
- 'disableothers': '1',
- }
- res=session.post(url,data)
- url='https://19se.cc/user'
- res=session.get(url)
- html=etree.HTML(res.text)
- v2=html.xpath('//*[@id="app"]/div/div[3]/section/div[4]/div[2]/div[3]/div[2]/div/a[3]/@data-clipboard-text')
- print(v2[0])
- ls.append(v2[0])
- def main():
- with futures.ThreadPoolExecutor(10) as executor: # <5>
- executor.map(one,mutiname(10)) # <6>
- main()
- with open('sub0.txt','a+',encoding='utf-8')as f:
- for lj in ls:
- f.write(lj)
- f.write('\n')
- print('it was writted successfully')
复制代码 |
|