In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
# Python uses the socks5 of Red Dance Agent to collect instances
Reprint: http://helpserver.chiwudaili.com/detail.aspx?id=a73406e4bdcc01ae615b649bf994bfb5
#
Import json
From time import sleep
Import requests
#
Def MyRequestGet (url,decode,proxyIPAndPort):
Print ("MyRequestGet ({0}, {1}, {2}) IN" .format (url,decode,proxyIPAndPort))
Headers = {'User-Agent':' Mozilla/5.0 (X11; Linux x86 / 64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'}
Rel = ""
If (len (proxyIPAndPort) > 0):
Proxies = {'http':' socks5://ip:port','https':'socks5://ip:port'}
Proxies ['http'] = "socks5:// {0}" .format (proxyIPAndPort)
Proxies ['https'] = "socks5:// {0}" .format (proxyIPAndPort)
# print (proxies)
Response = requests.get (url, proxies=proxies)
Rel = response.content.decode (decode)
Else:
Response = requests.get (url)
Rel = response.content.decode (decode)
Print ("MyRequestGet () OUT: {0}" .format (rel))
Return rel
#
Def MyGetPorxyIPAndPortFromChiWuDaiLi (phoneNumber,password):
Rel = ""
While (True):
Try:
Path = 'http://mainserver.chiwudaili.com:8000/api/GetProxyIPsAndPorts.ashx?';
Param = 'UserPhoneNumber= {0} & UserPassword= {1} & Count=1'.format (phoneNumber,password)
Url = "{0} {1}" .format (path,param)
StringJson = MyRequestGet (url,'utf-8', "")
ObjectJson = json.loads (stringJson)
If (objectJson ['Code'] = = 0):
If (objectJson ['Data'] [' State'] = = 0):
For index,value in enumerate (objectJson ['Data'] [' IPs']):
Rel = "{0}: {1}" .format (value ['IP'], value [' Port'])
Return rel
Else:
Print (objectJson ['Data'] [' Error'])
Sleep (5)
Else:
Print (objectJson ['Message'])
Sleep (5)
Except Exception as err:
Print (err)
Sleep (1)
Return rel
#
Def MyMain (phoneNumber,password):
Print ("MyMain () IN")
While (True):
# url = 'http://2018.ip138.com/ic.asp';decode='gb2312';
Url = 'http://helpserver.chiwudaili.com/';decode='utf-8';
# url = 'https://www.baidu.com/';decode='utf-8';
ProxyIPAndPort = MyGetPorxyIPAndPortFromChiWuDaiLi (phoneNumber,password)
Try:
While (True):
If (len (proxyIPAndPort) > 0):
Result = MyRequestGet (url,decode,proxyIPAndPort)
Print (result)
Else:
Print ('Get Proxy IP And Port failed')
Sleep (1)
Except Exception as err:
Print (err)
Finally:
Print ('do nothing')
Sleep (1)
Print ("MyMain () OUT")
#
# MyMain ('your mobile phone number', 'password')
MyMain ('13000000000)
#
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.