import requests import re from bs4 import BeautifulSoup import random import time def getip(): ip = ['120.83.108.143:9999', '49.70.17.89:9999', '120.83.108.92:9999', '113.124.85.204:9999', '114.239.42.220:9999', '113.121.21.114:9999', '112.87.70.169:9999', '163.204.244.130:9999', '163.204.243.190:9999', '120.83.123.245:9999', '182.35.87.115:9999', '114.230.69.151:9999', '182.35.80.50:9999', '163.204.247.42:9999', '120.83.106.57:9999', '113.110.72.19:8118', '60.13.42.40:9999', '163.204.242.121:9999', '171.11.32.97:9999', '42.238.82.110:9999', '144.123.69.21:9999', '117.91.232.60:9999', '120.83.108.235:9999', '163.204.241.228:9999', '180.119.141.35:9999', '121.226.188.51:9999', '120.83.105.104:9999', '122.143.135.109:80', '113.121.189.45:9999', '58.253.152.250:9999', '58.253.152.244:9999', '112.85.148.25:9999', '112.87.68.157:9999', '120.83.105.171:9999', '58.22.177.154:9999', '182.34.36.235:9999', '121.233.251.154:9999', '120.83.111.107:9999', '112.85.131.15:9999', '115.53.37.158:9999', '113.103.233.163:9999', '1.198.73.84:9999', '1.197.203.214:9999', '106.110.195.56:9999', '1.197.204.225:9999', '171.11.33.32:9999', '180.154.173.175:8118', '36.248.132.245:9999', '139.227.162.32:8118', '218.76.253.201:61408', '119.176.171.43:9999', '122.190.230.151:61234', '115.219.104.177:8010', '27.42.168.46:48919', '117.63.151.127:8118', '113.58.232.234:808', '140.250.172.205:9999', '183.163.37.99:61234', '112.87.70.183:9999', '114.239.254.32:9999', '61.157.136.105:808', '114.239.250.115:9999', '220.178.185.89:61234', '114.239.253.51:9999', '112.85.131.53:9999', '60.255.139.167:808', '115.195.86.122:8118', '112.85.130.170:9999', '1.193.158.218:9999', '112.85.172.215:9999', '112.85.130.56:9999', '112.85.170.7:9999', '112.85.128.185:9999', '112.85.167.226:9999', '114.239.254.150:9999', '218.75.69.50:39590', '113.86.151.149:8118', '171.15.67.97:9999', '112.111.217.68:9999', '182.35.81.40:9999', '36.248.129.67:9999', '113.119.38.177:3128', '60.216.101.46:59351', '120.83.97.75:9999', '117.57.91.134:61234', '182.35.87.246:9999', '182.35.82.54:9999', '113.58.234.71:808', '114.104.131.247:808', '117.95.192.203:9999', '182.35.81.5:9999', '42.159.91.248:8080', '119.138.225.23:8118', '171.11.32.187:9999', '175.148.79.98:1133', '117.95.192.73:9999', '60.13.42.58:9999', '117.91.249.82:9999', '182.34.33.243:9999', '112.85.171.67:9999', '117.95.232.151:9999', '175.42.129.250:9999', '113.124.94.255:808', '182.35.82.107:9999', '163.204.244.135:9999', '120.83.105.88:9999', '182.34.35.192:9999', '182.34.37.10:9999', '163.204.247.104:9999', '183.166.21.128:9999', '171.11.179.66:9999', '113.116.89.77:8118', '163.204.245.201:9999', '163.204.240.181:9999', '163.204.243.187:9999', '123.169.113.59:9999', '120.83.120.217:9999', '163.204.244.78:9999', '120.83.100.187:9999', '1.197.204.61:9999', '113.121.189.112:9999', '223.215.96.209:808', '163.204.243.29:9999', '163.204.247.225:9999', '163.204.244.99:9999', '113.121.189.172:9999', '117.95.214.132:9999', '120.83.109.87:9999', '182.34.34.30:9999', '1.198.42.210:9999', '117.95.232.75:9999', '163.204.240.143:9999', '123.169.119.253:9999', '120.83.107.161:9999', '58.253.157.134:9999', '120.83.104.64:9999', '112.87.69.106:9999', '182.116.225.23:9999', '60.13.42.178:9999', '123.163.96.169:9999', '115.53.17.52:9999', '171.12.41.55:9999', '60.13.42.147:9999', '120.83.105.216:9999', '112.87.68.39:9999', '112.85.150.16:9999', '182.34.36.113:9999', '123.163.96.79:9999', '163.204.243.252:9999', '163.204.241.255:9999', '112.85.165.3:9999', '112.85.167.186:9999', '112.85.165.80:9999', '58.253.157.187:9999', '60.13.42.166:9999', '117.95.162.58:9999', '60.13.42.172:9999', '122.193.245.197:9999', '120.83.109.94:9999', '114.239.29.228:9999', '120.83.122.102:9999', '123.163.96.80:9999', '163.204.245.218:9999', '114.239.253.191:9999', '112.87.70.6:9999', '120.83.101.19:9999', '163.204.243.120:9999', '113.124.93.227:9999', '112.85.128.245:9999', '222.89.32.132:9999', '123.169.126.105:9999', '60.13.42.228:9999', '112.85.164.93:9999', '120.83.108.47:9999', '58.253.155.134:9999', '114.239.29.68:9999', '182.35.87.82:9999', '1.197.203.209:9999', '122.193.244.125:9999', '27.43.185.130:9999', '163.204.246.117:9999', '117.28.97.111:9999', '182.34.36.119:9999', '117.95.192.60:9999', '120.83.110.1:9999', '112.87.70.159:9999', '122.4.49.113:9999', '1.197.16.134:9999', '120.83.105.144:9999', '112.87.71.235:9999', '113.124.93.0:9999', '144.123.68.224:23788', '120.84.100.209:9999', '112.85.169.49:9999', '120.83.111.147:9999', '183.166.20.245:9999', '163.204.241.199:9999', '120.83.97.34:9999', '120.83.109.230:9999', '58.253.154.234:9999', '120.83.123.228:9999', '117.28.96.51:9999', '120.83.107.31:9999', '120.83.108.70:9999', '182.34.37.152:9999', '42.238.90.246:9999', '117.64.149.17:808', '163.204.245.170:9999', '58.253.154.113:9999', '123.163.96.240:9999', '60.13.42.20:9999', '114.239.0.100:808', '123.163.96.118:9999', '120.83.108.104:9999', '60.13.42.124:9999', '1.197.203.168:9999', '120.84.100.253:9999', '58.253.153.246:9999', '112.85.131.61:9999', '58.253.156.22:9999', '115.219.109.225:8010', '120.83.110.224:9999', '115.53.38.237:9999', '60.13.42.165:9999', '180.119.141.149:9999', '125.73.220.18:31036', '115.231.5.230:44524', '113.128.28.203:9999', '113.128.120.200:9999', '119.5.152.239:61234', '113.128.9.48:9999', '113.128.30.18:9999', '121.224.4.63:61234', '113.128.122.101:9999', '123.245.12.10:8118', '121.61.89.253:61234', '182.35.82.180:9999', '183.165.153.8:61234', '117.95.192.249:9999', '221.225.43.111:9999', '221.225.43.246:9999', '117.95.175.87:9999', '117.95.199.221:9999', '221.225.43.205:9999', '60.13.42.9:9999', '117.85.49.106:9999', '112.85.165.140:9999', '113.128.31.55:61234', '175.153.90.242:61234', '49.72.99.106:61234', '182.34.21.149:9999', '1.198.111.236:9999', '112.87.64.10:9999', '60.13.42.216:9999', '60.13.42.202:9999', '175.42.122.191:9999', '163.204.241.10:9999', '121.61.29.65:61234', '106.75.8.141:808', '112.87.69.176:9999', '123.12.104.109:8118', '1.198.72.208:9999', '36.248.132.208:9999', '60.13.42.55:9999', '120.83.107.189:9999', '117.28.97.135:9999', '117.28.97.130:9999', '175.43.57.4:9999', '182.35.84.3:9999', '58.34.118.95:8118', '113.120.32.73:9999', '117.95.195.6:9999', '113.120.36.154:9999', '171.13.103.159:9999', '182.35.85.153:9999', '117.95.195.138:9999', '112.85.129.195:9999', '60.13.42.119:9999', '27.43.190.102:9999', '117.95.214.114:9999', '117.95.192.105:9999', '163.204.240.101:9999', '112.85.166.255:9999', '1.198.73.228:9999', '163.204.247.116:9999', '163.204.244.36:9999', '163.204.247.129:9999', '175.150.79.193:1133', '112.85.130.157:9999', '58.253.157.156:9999', '163.204.242.225:8888', '182.35.86.103:9999', '123.163.97.144:9999', '163.204.243.195:9999', '117.95.198.88:9999', '163.204.247.61:9999', '123.163.97.10:9999', '163.204.247.56:9999', '120.83.104.97:9999', '60.13.42.224:9999', '60.166.87.171:808', '163.204.242.143:9999', '60.13.42.168:9999', '163.204.243.32:9999', '58.253.156.36:9999', '163.204.95.106:9999', '163.204.246.34:9999', '163.204.247.52:9999', '112.85.170.188:9999', '60.13.42.41:9999', '182.35.84.77:9999', '112.87.70.218:9999', '114.239.255.78:9999', '163.204.240.108:9999', '163.204.247.134:9999', '60.13.42.51:9999', '112.85.131.5:9999', '163.204.243.129:9999', '60.13.42.139:9999', '60.13.42.24:9999', '120.83.108.95:9999', '163.204.244.180:9999', '117.28.96.101:9999', '163.204.241.218:9999', '121.226.214.126:9999', '163.204.241.173:9999', '117.95.232.42:9999', '123.169.123.195:9999', '163.204.244.64:9999', '112.85.164.225:9999', '182.35.82.62:9999', '60.13.42.141:9999', '182.35.86.136:9999', '58.253.158.202:9999', '120.83.110.64:9999', '112.85.168.251:9999', '163.204.246.226:9999', '117.64.149.210:808', '49.70.64.115:35661', '144.123.69.204:37707', '113.120.60.247:43587', '163.204.247.75:9999', '1.198.73.234:9999', '58.253.155.147:9999', '114.239.248.123:9999', '163.204.240.30:9999', '163.204.242.215:9999', '122.193.246.104:9999', '117.95.232.149:9999', '112.87.71.78:9999', '163.204.241.48:9999', '60.13.42.138:9999', '171.13.137.95:9999', '182.116.230.125:9999', '114.239.29.222:9999', '120.83.108.200:9999', '120.83.111.217:9999', '120.83.120.48:9999', '60.13.42.53:9999', '114.239.145.197:808', '106.111.53.190:9999', '120.84.102.103:9999', '58.253.159.58:9999', '113.121.23.119:9999', '58.253.158.9:9999', '27.43.185.133:9999', '113.124.85.211:9999', '113.12.202.50:40498', '163.204.242.32:9999', '112.85.168.214:9999', '112.85.131.55:9999', '112.87.67.122:9999', '113.121.21.200:53128', '120.83.104.187:9999', '123.169.34.216:9999', '112.85.166.181:9999', '27.43.186.70:9999', '123.163.122.55:9999', '58.253.153.90:9999', '113.120.35.70:9999', '182.116.225.6:9999', '182.116.235.142:9999', '163.204.244.246:9999', '113.120.61.157:49659', '182.116.231.211:9999', '113.120.61.177:9999', '182.116.237.110:9999', '182.116.237.41:9999', '113.100.9.66:61234', '183.166.103.42:9999', '163.204.246.244:9999', '119.176.197.107:9999', '49.86.181.7:9999', '112.85.164.97:9999', '1.193.246.161:9999', '112.85.130.165:9999', '119.254.94.93:46323', '223.215.176.123:808', '114.239.29.19:9999', '183.166.144.235:808', '114.239.110.110:9999', '163.204.240.63:9999', '180.168.13.26:8000', '222.128.9.235:59593', '218.59.193.14:47138', '121.226.74.242:808', '60.13.42.230:9999', '122.193.246.121:9999', '120.84.102.74:9999', '110.189.152.86:52277', '122.137.185.152:8118', '60.217.64.237:31923', '116.62.120.38:3128', '144.123.69.51:9999', '112.85.172.238:9999', '182.35.86.34:9999', '163.204.246.62:9999', '163.204.247.203:9999', '163.204.243.253:9999', '112.85.172.112:18118', '112.85.167.65:9999', '112.85.174.173:9999', '112.85.174.23:9999', '112.85.165.192:9999', '123.169.119.167:9999', '123.169.119.19:9999', '123.169.118.234:9999', '121.226.3.75:808', '59.32.37.82:8010', '123.169.116.163:9999', '123.169.112.89:9999', '123.169.119.254:9999', '123.169.114.124:9999', '58.253.155.89:9999', '163.204.241.35:9999', '58.253.154.219:9999', '123.169.35.119:45592', '113.121.23.154:9999', '163.204.246.162:9999', '60.13.42.67:9999', '1.197.204.238:9999', '112.85.128.48:9999', '120.83.105.165:9999', '120.83.107.124:9999', '163.204.242.142:9999', '163.204.240.140:9999', '60.13.42.3:9999', '120.83.97.38:9999', '42.238.81.226:9999', '163.204.244.239:9999', '182.35.80.92:9999', '163.204.246.152:9999', '123.169.34.219:9999', '222.89.32.186:9999', '163.204.242.252:9999', '1.197.16.23:9999', '112.85.131.160:9999', '27.43.185.183:9999', '113.121.20.145:9999', '117.64.149.65:808', '182.34.32.5:9999', '163.204.242.183:9999', '112.85.175.129:9999', '163.204.240.175:9999', '163.204.243.82:9999', '182.34.35.126:9999', '120.83.107.108:9999', '58.253.152.7:9999', '120.83.108.97:9999', '121.233.251.25:9999', '163.204.245.59:9999', '163.204.247.191:9999', '163.204.244.93:9999', '163.204.242.64:9999', '163.204.247.5:9999', '122.193.244.221:9999', '163.204.245.182:9999', '58.253.154.42:9999', '120.83.108.216:9999', '163.204.243.28:9999', '163.204.247.205:9999', '163.204.241.9:9999', '163.204.244.43:9999', '163.204.246.120:9999', '112.85.164.18:9999', '182.34.33.98:9999', '114.239.146.191:808', '120.83.110.134:9999', '163.204.242.99:9999', '60.13.42.171:9999', '163.204.243.54:9999', '163.204.242.131:9999', '113.121.21.132:9999', '163.204.247.111:9999', '163.204.247.105:9999', '120.83.110.247:9999', '120.83.105.233:9999', '163.204.243.90:9999', '60.13.42.17:9999', '163.204.247.115:9999', '120.83.99.99:808', '123.163.97.96:9999', '58.253.152.95:9999', '120.83.96.21:9999', '163.204.240.136:9999', '125.105.106.24:61234', '123.163.181.240:9999', '112.85.168.48:9999', '49.89.103.6:9999', '60.13.42.131:9999', '121.226.188.21:9999', '113.121.37.122:808', '163.204.246.33:9999', '27.43.191.252:9999', '163.204.241.194:9999', '120.83.106.80:9999', '114.239.251.91:9999', '182.116.239.125:9999', '120.83.96.55:808', '163.204.242.38:9999', '182.35.81.30:9999', '163.204.246.23:9999', '114.239.144.54:808', '113.124.86.187:9999', '113.121.20.175:9999', '112.85.169.30:9999', '27.43.187.33:9999', '60.13.42.238:9999', '113.121.41.230:20013', '123.169.122.70:9999', '163.204.245.151:9999', '120.83.108.158:9999', '163.204.242.161:9999', '163.204.242.3:9999', '163.204.245.184:9999', '120.83.111.39:9999', '182.35.84.6:9999', '106.42.48.229:9999', '1.197.204.248:9999', '112.87.68.90:9999', '114.239.253.118:9999', '163.204.243.11:9999', '58.58.213.55:8888', '120.83.105.127:9999', '163.204.241.41:9999', '49.89.103.147:9999', '163.204.243.4:9999', '163.204.242.108:9999', '113.121.22.117:9999', '163.204.246.213:9999', '144.123.69.130:9999', '163.204.243.251:9999', '222.89.32.190:9999', '163.204.242.177:9999', '60.169.114.242:808', '58.253.156.133:9999', '120.83.122.11:808', '171.11.178.125:9999', '182.35.81.74:9999', '163.204.243.70:9999', '27.43.191.13:9999', '163.204.244.68:9999', '163.204.243.218:9999', '120.83.98.252:9999', '114.239.172.222:9999', '113.120.35.94:9999', '182.35.82.71:9999', '163.204.242.31:9999', '163.204.242.159:9999', '120.83.107.252:9999', '112.85.170.145:9999', '117.95.195.216:9999', '163.204.245.30:9999', '117.95.162.6:9999', '49.89.103.226:9999', '49.89.222.255:9999', '113.128.8.125:25389', '115.221.118.196:61234', '114.239.251.92:9999', '117.85.105.66:9999', '58.254.220.116:52470', '112.87.65.199:9999', '1.193.244.197:9999', '221.218.102.146:33323', '163.204.243.163:9999', '1.193.158.108:9999', '113.103.226.221:61234', '182.116.238.39:9999', '60.13.42.189:9999', '101.27.20.52:61234', '171.15.173.103:9999', '171.15.49.100:9999', '115.53.16.229:9999', '115.53.35.245:9999', '120.83.107.253:9999', '112.87.69.170:9999', '171.15.174.238:9999', '115.53.19.183:9999', '115.53.21.87:9999', '1.193.244.194:9999', '175.153.90.140:61234', '120.83.97.158:9999', '112.85.170.88:9999', '175.148.70.18:1133', '58.253.156.63:9999', '175.42.68.158:30089', '58.253.155.138:9999', '119.176.171.47:9999', '221.206.100.133:34073', '120.83.106.234:9999', '120.83.101.248:9999', '120.83.108.152:9999', '112.87.69.41:9999', '112.85.130.22:9999', '120.83.102.246:9999', '113.120.35.174:9999', '163.204.243.199:9999', '163.204.244.31:9999', '163.204.240.64:9999', '60.13.42.142:9999', '163.204.246.205:9999', '60.13.42.243:9999', '112.85.150.248:9999', '163.204.244.115:9999', '42.238.80.204:9999', '58.253.156.81:9999', '113.124.85.217:9999', '182.35.80.33:9999', '117.95.232.74:9999', '60.13.42.200:9999', '120.83.108.127:9999', '120.83.104.95:9999', '163.204.242.173:9999', '222.89.32.171:9999', '58.253.152.101:9999', '112.87.71.187:9999', '222.89.32.177:9999', '117.28.96.229:9999', '117.28.96.224:9999', '182.35.84.132:9999', '163.204.247.24:9999', '163.204.241.79:9999', '163.204.243.191:9999', '60.13.42.129:9999', '117.28.96.210:9999', '112.87.69.86:9999', '122.193.246.179:9999', '120.83.122.244:9999', '60.13.42.64:9999', '60.13.42.105:9999', '112.85.164.29:9999', '182.34.27.4:9999', '112.85.131.62:9999', '120.83.102.119:9999', '60.13.42.220:9999', '171.11.178.240:9999', '60.13.42.241:9999', '49.70.48.174:9999', '60.13.42.91:9999', '60.13.42.104:9999', '112.85.130.197:9999', '180.119.141.209:22646', '117.64.149.221:808', '60.13.42.97:9999', '120.83.123.223:9999', '58.253.152.145:9999', '163.204.243.243:9999', '182.34.34.124:9999', '60.13.42.27:9999', '182.34.33.2:9999', '1.197.10.24:9999', '120.83.123.143:9999', '120.83.106.42:9999', '182.35.81.245:9999', '113.121.65.151:9999', '60.13.42.63:9999', '183.166.103.134:9999', '113.65.5.14:8118', '49.70.89.166:9999', '182.35.85.209:9999', '60.13.42.60:9999', '163.204.240.73:9999', '120.83.106.172:9999', '222.89.32.139:9999', '112.87.68.248:9999', '112.85.173.108:9999', '60.13.42.82:9999', '163.204.240.194:9999', '58.253.157.32:9999', '42.238.85.216:9999', '120.83.107.52:9999', '120.83.110.50:9999', '182.34.35.139:9999', '112.87.69.44:9999', '120.84.103.176:9999', '60.13.42.247:9999', '113.121.23.190:9999', '115.53.18.40:9999', '114.239.151.118:9999', '113.121.20.107:9999', '163.204.243.73:9999', '163.204.240.207:9999', '117.95.198.105:9999', '163.204.243.115:9999', '163.204.244.42:9999', '58.253.157.108:9999', '115.239.63.56:61234', '42.238.85.20:9999', '114.239.3.138:9999', '1.198.73.193:9999', '112.85.164.192:9999', '120.83.103.129:9999', '27.43.185.20:9999', '112.87.71.153:9999', '122.4.51.179:9999', '163.204.246.224:9999', '58.253.152.136:9999', '60.13.42.96:9999', '112.87.69.76:9999', '122.193.246.162:9999', '60.13.42.175:9999', '175.155.142.235:1133', '218.24.16.198:43620', '121.226.214.178:9999', '115.53.32.87:9999', '60.13.42.115:9999', '60.13.42.155:9999', '120.83.104.213:9999', '114.239.110.112:9999', '42.238.90.250:9999', '113.124.87.58:9999', '120.83.109.194:9999', '120.83.107.19:9999', '112.85.170.61:9999', '183.45.79.193:8118', '27.43.184.187:9999', '60.13.42.81:9999', '182.35.81.96:9999', '113.128.120.53:61234', '120.83.111.206:9999', '113.121.21.72:9999', '120.83.108.72:9999', '123.169.126.72:9999', '163.204.240.190:9999', '163.204.245.47:9999', '120.83.100.23:9999', '182.34.36.201:9999', '120.83.109.142:9999', '175.42.158.144:9999', '120.83.96.28:9999', '117.80.4.174:808', '182.34.34.45:9999', '58.253.158.141:9999', '112.85.129.84:9999', '120.83.108.57:9999', '120.83.96.16:9999', '60.13.42.8:9999', '60.13.42.132:9999', '120.83.107.225:9999', '58.253.155.110:9999', '60.13.42.98:9999', '113.121.21.176:9999', '60.13.42.49:9999', '163.204.246.161:9999', '171.11.32.219:9999', '117.91.250.112:9999', '114.239.248.61:9999', '49.86.181.179:9999', '120.83.107.12:9999', '163.204.242.23:9999', '115.221.120.154:28160', '49.70.64.164:9999', '114.239.110.243:9999', '112.85.149.131:9999', '182.35.87.39:9999', '58.253.154.174:9999', '115.202.156.187:39589', '117.80.92.168:9999', '112.85.129.241:9999', '120.83.109.61:9999', '182.35.86.155:9999', '58.253.157.133:9999', '123.52.150.204:9999', '112.85.171.70:9999', '120.83.99.88:9999', '49.70.11.193:61234', '114.217.218.229:8118', '60.13.42.92:9999', '113.58.232.159:22', '163.204.243.105:9999', '112.85.166.189:9999', '123.163.96.196:9999', '175.155.139.112:1133', '221.6.138.154:30893', '36.248.133.213:9999', '120.83.103.35:808', '163.204.247.219:9999', '36.250.156.11:9999', '182.35.80.82:9999', '122.193.246.141:9999', '182.35.82.115:9999', '58.20.79.188:8118', '163.204.245.254:9999', '113.120.34.108:9999', '175.11.195.119:8118', '121.233.226.97:9999', '163.204.245.37:9999', '182.116.225.142:9999', '120.83.107.73:9999', '112.85.130.10:9999', '117.95.200.238:9999', '113.124.95.153:9999', '60.13.42.152:9999', '163.204.245.252:9999', '120.83.111.142:9999', '1.197.203.178:9999', '60.13.42.226:9999', '182.34.33.215:9999', '182.34.35.117:9999', '120.83.110.175:9999', '112.85.167.231:9999', '175.155.141.252:1133', '117.28.96.212:9999', '163.204.247.240:9999', '1.198.73.137:9999', '163.204.242.26:9999', '112.87.70.147:9999', '112.85.167.250:9999', '222.89.32.157:9999', '60.13.42.234:9999', '163.204.240.8:9999', '113.124.86.15:9999', '60.13.42.76:9999', '1.199.31.22:9999', '123.52.43.64:8118', '112.85.131.219:9999', '112.85.165.194:9999', '120.83.108.113:9999', '163.204.245.229:9999', '114.239.253.224:9999', '120.83.121.35:9999', '1.198.73.27:9999', '182.34.21.227:9999', '163.204.242.1:9999', '112.85.131.175:9999', '49.70.85.92:9999', '120.83.102.140:9999', '117.28.97.7:9999', '182.34.33.117:9999', '180.116.216.159:8118', '163.204.244.168:9999', '163.204.242.60:9999', '222.72.166.235:53281', '163.204.242.244:9999', '182.34.37.133:9999', '163.204.241.12:9999', '163.204.240.146:9999', '60.13.42.12:9999', '117.95.232.247:9999', '163.204.244.224:9999', '163.204.245.241:9999', '182.34.36.178:9999', '112.85.128.142:9999', '120.83.99.165:9999', '114.239.249.75:9999', '171.11.33.249:9999', '101.27.20.62:61234', '163.204.243.111:9999', '163.204.243.201:9999', '113.121.21.123:808', '113.120.32.136:9999', '182.35.81.134:9999', '112.85.167.70:9999', '60.13.42.15:9999', '113.124.84.131:9999', '144.255.49.46:9999', '120.83.111.71:9999', '163.204.242.253:8118', '163.204.245.146:9999', '163.204.242.87:9999', '1.197.204.41:9999', '182.34.33.156:9999', '163.204.244.131:9999', '112.85.165.212:9999', '60.13.42.149:9999', '113.121.22.8:9999', '1.197.204.80:9999', '49.70.95.209:9999', '163.204.247.37:9999', '180.107.24.148:8118', '163.204.245.15:9999', '113.124.94.158:9999', '120.83.103.153:9999', '163.204.242.41:9999', '58.253.157.209:9999', '106.110.212.115:9999', '163.204.247.89:9999', '163.204.243.15:9999', '1.197.11.57:9999', '163.204.244.162:9999' ] b = random.randint(0,899) print("ip:"+str(b)) return ip[b] def getagent(): list1 = [ 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.163 Safari/535.1', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0) Gecko/20100101 Firefox/6.0', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50', 'Opera/9.80 (Windows NT 6.1; U; zh-cn) Presto/2.9.168 Version/11.50', 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36', 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB7.0)', 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)', 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)', 'Mozilla/5.0 (Windows; U; Windows NT 6.1; ) AppleWebKit/534.12 (KHTML, like Gecko) Maxthon/3.0 Safari/534.12', 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)'] a=random.randint(0, 9) return list1[a] def getData(p,url): url = url %p print("url2:"+url) headers = { 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Language' : 'zh-CN,zh;q=0.8', 'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36' } proxies = {'http:':getip()} html = requests.get(url,headers = headers,proxies = proxies,timeout=30) # print(html.text) ht = BeautifulSoup(html.text,'html.parser') lis = ht.find_all('div',class_='result_item_top') # print(lis) urlList = [] illnesList = [] file = open('outPut/全部疾病1.txt','a',encoding='utf-8',buffering=1) for li in lis : #慢性病页面抓取详情页面的url # print(li) lableP = li.find('p',class_='result_item_top_l') lableA = lableP.find('a') title = lableA.get_text() illnesList.append(title) url = str(lableA).split('"')[1] urlList.append(url) sem = 0 for ur in urlList: #循环每个详情页面 抓取键值对数据 html2 = requests.get(ur,headers = headers,proxies = proxies,timeout=30) bs = BeautifulSoup(html2.text,'html.parser') # print(bs) result = {} if(bs.find('ul', class_='information_ul') != None): information_ul = bs.find('ul', class_='information_ul') liList = information_ul.find_all('li') result['病名:'] = illnesList[sem] for li in liList: i = li.find('i').get_text() span = li.find('span').get_text() result[i] = span sem += 1 bottom = bs.find('ul', class_="information_ul information_ul_bottom") bli = bottom.find('li') name = bli.find('i').get_text() values = [] for b in bli.find('span').find_all('a'): values.append(b.get_text()) result[name] = values.__str__() elif(bs.find("ul",class_="infolist") != None): result['病名:'] = illnesList[sem] infolist = bs.find('ul',class_='infolist') liList1 = infolist.find_all('li') for lii in liList1: if(lii.find('span') != None): strSpan = lii.find('span') strSpan = strSpan.get_text() SplitStrSpan = str(strSpan).strip().split(":",2) result[SplitStrSpan[0]]=SplitStrSpan[SplitStrSpan.__len__()-1] else: continue sem += 1 else: continue print(result.__str__()) file.write(result.__str__() + '\n') if __name__ == '__main__': urlList = [ # 'http://jbk.39.net/bw/lunao_p%d/|78', # 'http://jbk.39.net/bw/yan_p%d/|81', # 'http://jbk.39.net/bw/bi_p%d/|24', # 'http://jbk.39.net/bw/er_p%d/|16', # 'http://jbk.39.net/bw/mianbu_p%d/|17', # 'http://jbk.39.net/bw/kou_p%d/|40', # 'http://jbk.39.net/bw/yanhou_p%d/|21', # 'http://jbk.39.net/bw/toubu_t3_p%d/|32', # 'http://jbk.39.net/bw/toubu_t4_p%d/|23', # 'http://jbk.39.net/bw/jiazhuangxian_p%d/|10', # 'http://jbk.39.net/bw/qiguan_p%d/|4', # 'http://jbk.39.net/bw/jingbu_t3_p%d/|6', # 'http://jbk.39.net/bw/jingbu_t4_p%d/|3', # 'http://jbk.39.net/bw/rufang_p%d/|9', # 'http://jbk.39.net/bw/fei_p%d/|44', # 'http://jbk.39.net/bw/xinzang_p%d/|32', # 'http://jbk.39.net/bw/shiguan_p%d/|9', # 'http://jbk.39.net/bw/geji_p%d/|2', # 'http://jbk.39.net/bw/zongge_p%d/|3', # 'http://jbk.39.net/bw/xiongbu_t3_p%d/|19', # 'http://jbk.39.net/bw/xiongbu_t4_p%d/|11', # 'http://jbk.39.net/bw/wei_p%d/|22', # 'http://jbk.39.net/bw/chang_p%d/|37', # 'http://jbk.39.net/bw/gan_p%d/|27', # 'http://jbk.39.net/bw/lanwei_p%d/|2', # 'http://jbk.39.net/bw/yixian_p%d/|10', # 'http://jbk.39.net/bw/pi_p%d/|4', # 'http://jbk.39.net/bw/dan_p%d/|9', # 'http://jbk.39.net/bw/fumo_p%d/|3', # 'http://jbk.39.net/bw/chagnximo_p%d/|3', # 'http://jbk.39.net/bw/fubu_t3_p%d/|29', # 'http://jbk.39.net/bw/fubu_t4_p%d/|15', # 'http://jbk.39.net/bw/shen_p%d/|33', # 'http://jbk.39.net/bw/shenshangxian_p%d/|4', # 'http://jbk.39.net/bw/shuniaoguan_p%d/|5', # 'http://jbk.39.net/bw/yaobu_t3_p%d/|15', # 'http://jbk.39.net/bw/yaobu_t4_p%d/|2', # 'http://jbk.39.net/bw/qianliexian_p%d/|3', # 'http://jbk.39.net/bw/gaowan_p%d/|3', # 'http://jbk.39.net/bw/yinjing_p%d/|5', # 'http://jbk.39.net/bw/shujingguan_p%d/|1', # 'http://jbk.39.net/bw/yinnang_p%d/|2', # 'http://jbk.39.net/bw/nanxingshengzhi_t3_p%d/|6', # 'http://jbk.39.net/bw/nanxingshengzhi_t4_p%d/|3', # 'http://jbk.39.net/bw/luanchao_p%d/|7', # 'http://jbk.39.net/bw/zigong_p%d/|19', # 'http://jbk.39.net/bw/shuluanguan_p%d/|3', # 'http://jbk.39.net/bw/yindao_p%d/|9', # 'http://jbk.39.net/bw/waiyin_p%d/|8', # 'http://jbk.39.net/bw/nvxingshengzhi_t3_p%d/|14', # 'http://jbk.39.net/bw/nvxingshengzhi_t4_p%d/|8', # 'http://jbk.39.net/bw/pifu_p%d/|94', # 'http://jbk.39.net/bw/linba_p%d/|11', # 'http://jbk.39.net/bw/xueyexueguan_p%d/|100', # 'http://jbk.39.net/bw/mianyixitong_p%d/|21', # 'http://jbk.39.net/bw/jirou_p%d/|19', # 'http://jbk.39.net/bw/zhouweishenjingxitong_p%d/|13', # 'http://jbk.39.net/bw/quanshen_t3_p%d/|95', # 'http://jbk.39.net/bw/quanshen_t4_p%d/|9', # 'http://jbk.39.net/bw/jianbu_p%d/|5', # 'http://jbk.39.net/bw/shangbi_p%d/|2', # 'http://jbk.39.net/bw/zhoubu_p%d/|3', # 'http://jbk.39.net/bw/qianbi_p%d/|5', # 'http://jbk.39.net/bw/shoubu_p%d/|18', # 'http://jbk.39.net/bw/shangzhi_t3_p%d/|7', # 'http://jbk.39.net/bw/shangzhi_t4_p%d/|8', # 'http://jbk.39.net/bw/datui_p%d/|3', 'http://jbk.39.net/bw/xiaotui_p%d/|4', 'http://jbk.39.net/bw/xibu_p%d/|6', 'http://jbk.39.net/bw/zubu_p%d/|12', 'http://jbk.39.net/bw/pangguang_p%d/|7', 'http://jbk.39.net/bw/niaodao_p%d/|7', 'http://jbk.39.net/bw/penqiang_t3_p%d/|5', 'http://jbk.39.net/bw/penqiang_t4_p%d/|2', 'http://jbk.39.net/bw/gangmen_p%d/|10', 'http://jbk.39.net/bw/tunbu_t3_p%d/|3', 'http://jbk.39.net/bw/tunbu_t4_p%d/|3', 'http://jbk.39.net/bw/gusui_p%d/|6', 'http://jbk.39.net/bw/shagnzhigu_p%d/|7', 'http://jbk.39.net/bw/xiazhigu_p%d/|7', 'http://jbk.39.net/bw/guanjie_p%d/|21', 'http://jbk.39.net/bw/jizhu_p%d/|12', 'http://jbk.39.net/bw/lugu_p%d/|3', 'http://jbk.39.net/bw/leigu_p%d/|1', 'http://jbk.39.net/bw/pengu_p%d/|4', 'http://jbk.39.net/bw/jisui_p%d/|8', 'http://jbk.39.net/bw/gu_t3_p%d/|8', 'http://jbk.39.net/bw/gu_t4_p%d/|7'] for url in urlList: splits = url.split("|") Url = splits[0] # nember = int(splits[1]) print("url1:"+Url) for p in range(1,int(url.split("|")[1])+1): print(p) getData(p,splits[0])