def myList(self): """ 猫眼首页 """ sy_url = "/" header = {"User-Agent": random.choice(UserAgent.random_userAgent())} # print("header=====",header) with self.client.get(sy_url, headers=header, proxies=random.choice(self.arrProxy), verify=False, allow_redirects=False, catch_response=True) as response: # print("响应结果======{}".format(response.text)) if "正在热映" in response.text: font_file_name = re.findall( r'//vfile.meituan.net/colorstone/(.*?).woff', response.text)[0] url = 'http://vfile.meituan.net/colorstone/{}.woff'.format( font_file_name) res = requests.get(url, headers=header) with open(self.newWoffPath, 'wb') as f: f.write(res.content) print("写入成功") dictList = FontFaceDecode(self.oldWoffPath, self.newWoffPath, self.newXmlName) # font=TTFont(self.filename2) # font.saveXML("F:/myTestFile/TestObject/TongChuangYuanMa/txt_file/file4.xml") # newuniList=font.getGlyphOrder()[2:] print("33333======", dictList)
def on_start(self): user_ggent = random.choice(UserAgent.random_userAgent()) self.header = {"User-Agent": user_ggent} filePath = "F:/proxyList.txt" proxyArr = self.readText(filePath) #ip代理 self.arrProxy = [] for pro in proxyArr: self.arrProxy.append({"http": pro[0] + ":" + pro[1]})
def on_start(self): user_ggent = random.choice(UserAgent.random_userAgent()) self.header = { "User-Agent": user_ggent, "Referer": "https://maoyan.com/" } filePath = "F:/proxyList.txt" proxyArr = self.readText(filePath) #ip代理 self.arrProxy = [] for pro in proxyArr: self.arrProxy.append({"http": pro[0] + ":" + pro[1]}) self.oldWoffPath = "F:/myTestFile/TestObject/TongChuangYuanMa/txt_file/file2.woff" self.newWoffPath = "F:/myTestFile/TestObject/TongChuangYuanMa/txt_file/file4.woff" self.newXmlName = "F:/myTestFile/TestObject/TongChuangYuanMa/txt_file/maoyan4.xml"
def myList(self): """ 猫眼首页 """ sy_url = "/" header = {"User-Agent": random.choice(UserAgent.random_userAgent())} print("header=====",header) with self.client.get(sy_url, headers = header, proxies = random.choice(self.arrProxy), verify = False,allow_redirects=False,catch_response=True) as response: # print("响应结果======{}".format(response.text)) print("111111") if "正在热映" in response.text: print("9999999",response.text) else: print("33333",type(response),response)
def on_start(self): self.header ={ "Connection":"keep-alive", "app-type":"android", #android "mobile-unid":str(int(round(time.time() * 100000))), "app-version":"5.5.4.1", "mobile-type":"HUAWEIALP-TL00(8.0.0)", "mobile-system":"android8.0.0", "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", "Content-Type": "application/x-www-form-urlencoded", } self.apikey="djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh" self.publicData = PublicDataClass(self) self.PengYou = PengYouClass(self) self.login_res = self.PengYou.login(self.apikey,self.header) #登录
def on_start(self): # self.header ={ # "Connection":"keep-alive", # "app-type":"android", #android # "mobile-unid":str(int(round(time.time() * 100000))), # "app-version":"5.5.4.1", # "mobile-type":"HUAWEIALP-TL00(8.0.0)", # "mobile-system":"android8.0.0", # "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # # "User-Agent":random.choice(UserAgent.random_userAgent()), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", # "Content-Type": "application/x-www-form-urlencoded" # } self.header = { "Connection": "keep-alive", "app-type": "android", #android "mobile-unid": str(int(round(time.time() * 100000))), "app-version": "5.5.4.1", "mobile-type": "HUAWEIALP-TL00(8.0.0)", "mobile-system": "android8.0.0", "device-tokens": "AkWsVNSPMcwhC6nAXITHbPyrv0YgG5nt1T0B8n79-lrN", # "User-Agent": random.choice( UserAgent.random_userAgent() ), #"Dalvik/2.1.0 (Linux; U; Android 8.0.0; ALP-TL00 Build/HUAWEIALP-TL00)", "Content-Type": "application/x-www-form-urlencoded", "app-type": "ios", "app-version": "5.6.1", "device-tokens": "324bf4fa8b6d8c37b98e86f6366833fa9f2b73df648ee83e062b660f0e19ad43", "Content-Type": "application/x-www-form-urlencoded", "mobile-unid": "c8eb9ab231654cb58a14bd24f9062781", "mobile-system": "12.4.8", "User-Agent": "(iPhone; iOS 12.4.8; Scale/2.00) YunZhangBen/5.6.1", "mobile-type": "iPhone 6" } self.apikey = "djakdgkadgkafddadfjaddgbadsbfhbdashbgfadssfhbh" # self.sfz_path = "F:/myTestFile/TestObject/YouTime/yunqianbao/static/shenfenzheng.txt" self.publicData = PublicDataClass(self) self.rmhd = ReMenHuoDong(self) self.login_res = self.publicData.login(self.apikey, self.header) #登录