コード例 #1
0
ファイル: xls.py プロジェクト: skducn/project
# -*- coding: utf-8 -*-

import json, jsonpath

import instance.zyjk.EHR.frame1.readConfig as readConfig
localReadConfig = readConfig.ReadConfig()
import reflection
from PO.OpenpyxlPO import *
from PO.DataPO import *
Data_PO = DataPO()
from datetime import datetime

# 定义全局字典变量
d_var = {}


class XLS:
    def __init__(self):

        # 初始化表格
        if platform.system() == 'Darwin':
            self.varExcel = os.path.dirname(
                os.path.abspath("__file__")
            ) + u'/config/' + localReadConfig.get_system("excelName")
        if platform.system() == 'Windows':
            self.varExcel = os.path.dirname(
                os.path.abspath("__file__")
            ) + u'\config\\' + localReadConfig.get_system("excelName")
        self.Openpyxl_PO = OpenpyxlPO(self.varExcel)
        self.Openpyxl_PO.closeExcelPid('EXCEL.EXE')  # 关闭excel进程
        l_sheetNames = (self.Openpyxl_PO.wb.sheetnames
コード例 #2
0
# http://175.43.57.47:9999
# http://219.151.157.130:3128
# http://114.239.2.151:9999
# http://180.120.209.130:8888
# http://183.166.163.192:9999
# http://113.120.62.237:9999
# http://120.83.96.49:9999
# http://182.46.122.112:9999
# http://163.204.247.194:9999
# http://150.255.8.206:9999
# http://49.86.182.169:9999
# http://49.86.176.213:9999

import requests,json
from PO.DataPO import *
Data_PO = DataPO()

print(Data_PO.getIpAgent())
print(Data_PO.getUserAgent())
proxies = {"url": "http://183.166.163.192:9999"}
print(proxies)
headers = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36"}
# headers = {'user-agent': Data_PO.getUserAgent()}
response = requests.get(url="https://www.toutiao.com/api/pc/feed/?min_behot_time=0&refresh_count=1&category=__all__&utm_source=toutiao&widen=1&tadrequire=true&_signature=_02B4Z6wo00d01fvn0YwAAIDCSxY9RVtwNlH7wtUAAB6A2JVj2nlWEjSOc-lM3cuw3CMwjgeCaE3YOlaB8m9h1KXkLks00Mx0nTEqpVhbWkT4F6PcW6NjNqpMl6ecsp8crnX41QHPcvftP6C323"
                        ,headers=headers
                        ,proxies=proxies)

# print(response.text)
print(response.text.encode("utf-8").decode("unicode_escape"))
print("---------------")
response_json = json.loads(response.text)