MCPcopy
hub / github.com/lining0806/PythonSpiderNotes / get_proxy_list

Function get_proxy_list

QunarSpider/QunarSpider.py:69–79  ·  view source on GitHub ↗
(file_path)

Source from the content-addressed store, hash-verified

67 flag = False
68
69def get_proxy_list(file_path):
70 proxy_list = []
71 try:
72 f = open(file_path, 'r')
73 all_lines = f.readlines() # readlines()每次按行读取整个文件内容,将读取到的内容放到一个列表中,返回list类型。
74 for line in all_lines:
75 proxy_list.append(line.replace('\r', '').replace('\n', ''))
76 f.close()
77 except Exception as e:
78 print e
79 return proxy_list
80
81def ticket_worker_proxy(city_proxy):
82 city = city_proxy.split(',')[0]

Callers 1

all_ticket_proxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected