Skip to content

Commit 3f38101

Browse files
author
bigdata
committed
add kuaidaili
1 parent 70ef91f commit 3f38101

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

Config.ini

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
;type: SSDB/REDIS/MONGODB if use redis, only modify the host port,the type should be SSDB
44
type = SSDB
55
host = localhost
6+
;port = 6379
67
port = 8888
78
name = proxy
89

@@ -14,8 +15,9 @@ freeProxyThird = 1
1415
freeProxyFourth = 1
1516
freeProxyFifth = 1
1617
freeProxySixth = 1
18+
freeProxySeventh = 1
1719

1820
[HOST]
1921
; API接口配置 http://127.0.0.1:5051
2022
ip = 0.0.0.0
21-
port = 5010
23+
port = 5010

Dockerfile

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
FROM python:3.6
2-
32
WORKDIR /usr/src/app
4-
53
COPY . .
6-
74
ENV DEBIAN_FRONTEND noninteractive
85
ENV TZ Asia/Shanghai
9-
106
RUN pip install --no-cache-dir -r requirements.txt && \
117
apt-get update && \
128
apt-get install -y --force-yes git make gcc g++ autoconf && apt-get clean && \
@@ -16,7 +12,6 @@ RUN pip install --no-cache-dir -r requirements.txt && \
1612
apt-get autoremove -y && \
1713
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
1814
cp ssdb.conf /etc && cd .. && yes | rm -r ssdb && \
19-
2015
mkdir -p /var/lib/ssdb && \
2116
sed \
2217
-e 's@home.*@home /var/lib@' \
@@ -26,14 +21,10 @@ RUN pip install --no-cache-dir -r requirements.txt && \
2621
-e 's@level:.*@level: info@' \
2722
-e 's@ip:.*@ip: 0.0.0.0@' \
2823
-i /etc/ssdb.conf && \
29-
3024
echo "# ! /bin/sh " > /usr/src/app/run.sh && \
3125
echo "cd Run" >> /usr/src/app/run.sh && \
3226
echo "/usr/bin/ssdb-server /etc/ssdb.conf &" >> /usr/src/app/run.sh && \
3327
echo "python main.py" >> /usr/src/app/run.sh && \
34-
3528
chmod 777 run.sh
36-
3729
EXPOSE 5010
38-
3930
CMD [ "sh", "run.sh" ]

ProxyGetter/getFreeProxy.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,18 @@ def freeProxySixth():
149149
except Exception as e:
150150
pass
151151

152+
@staticmethod
153+
def freeProxySeventh():
154+
"""
155+
快代理免费https://www.kuaidaili.com/free/inha/1/
156+
"""
157+
url = 'https://www.kuaidaili.com/free/inha/{page}/'
158+
for page in range(1, 10):
159+
page_url = url.format(page=page)
160+
tree = getHtmlTree(page_url)
161+
proxy_list = tree.xpath('.//table//tr')
162+
for tr in proxy_list[1:]:
163+
yield ':'.join(tr.xpath('./td/text()')[0:2])
152164

153165
if __name__ == '__main__':
154166
gg = GetFreeProxy()
@@ -164,8 +176,10 @@ def freeProxySixth():
164176
# for e in gg.freeProxyFourth():
165177
# print(e)
166178

167-
for e in gg.freeProxyFifth():
168-
print(e)
179+
#for e in gg.freeProxyFifth():
180+
# print(e)
169181

170182
# for e in gg.freeProxySixth():
171183
# print(e)
184+
for e in gg.freeProxySeventh():
185+
print(e)

0 commit comments

Comments
 (0)