-
以后再也不用擔(dān)心寫(xiě)爬蟲(chóng)ip被封,不用擔(dān)心沒(méi)錢(qián)買(mǎi)代理ip的煩惱了
在使用python寫(xiě)爬蟲(chóng)時(shí)候,你會(huì)遇到所要爬取的網(wǎng)站有反爬取技術(shù)比如用同一個(gè)IP反復(fù)爬取同一個(gè)網(wǎng)頁(yè),很可能會(huì)被封。如何有效的解決這個(gè)問(wèn)題呢?我們可以使用代理ip,來(lái)設(shè)置代理ip池。
現(xiàn)在教大家一個(gè)可獲取大量免費(fèi)有效快速的代理ip方法,我們?cè)L問(wèn)西刺免費(fèi)代理ip網(wǎng)址
這里面提供了許多代理ip,但是我們嘗試過(guò)后會(huì)發(fā)現(xiàn)并不是每一個(gè)都是有效的。所以我們現(xiàn)在所要做的就是從里面提供的篩選出有效快速穩(wěn)定的ip。
以下介紹的免費(fèi)獲取代理ip池的方法:
優(yōu)點(diǎn):免費(fèi)、數(shù)量多、有效、速度快
缺點(diǎn):需要定期篩選
主要思路:
從網(wǎng)址上爬取ip地址并存儲(chǔ)
驗(yàn)證ip是否能使用-(隨機(jī)訪問(wèn)網(wǎng)址判斷響應(yīng)碼)
格式化ip地址
代碼如下:
1.導(dǎo)入包
import requests
from lxml import etree
import time
1
2
3
2.獲取西刺免費(fèi)代理ip網(wǎng)址上的代理ip
def get_all_proxy():
url = 'http://www.xicidaili.com/nn/1'
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36',
}
Response = requests.get(url, headers=headers)
html_ele = etree.HTML(Response.text)
ip_eles = html_ele.xpath('//table[@id="ip_list"]/tr/td[2]/text()')
port_ele = html_ele.xpath('//table[@id="ip_list"]/tr/td[3]/text()')
proxy_list = []
for i in range(0,len(ip_eles)):
proxy_str = 'http://' + ip_eles[i] + ':' + port_ele[i]
proxy_list.append(proxy_str)
return proxy_list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
3.驗(yàn)證獲取的ip
def check_all_proxy(proxy_list):
valid_proxy_list = []
for proxy in proxy_list:
url = 'http://www.baidu.com/'
proxy_dict = {
'http': proxy
}
try:
start_time = time.time()
Response = requests.get(url, proxies=proxy_dict, timeout=5)
if Response.status_code == 200:
end_time = time.time()
print('代理可用:' + proxy)
print('耗時(shí):' + str(end_time - start_time))
valid_proxy_list.append(proxy)
else:
print('代理超時(shí)')
except:
print('代理不可用--------------->'+proxy)
return valid_proxy_list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
4.輸出獲取ip池
if __name__ == '__main__':
proxy_list = get_all_proxy()
valid_proxy_list = check_all_proxy(proxy_list)
print('--'*30)
print(valid_proxy_list)
1
2
3
4
5
技術(shù)能力有限歡迎提出意見(jiàn),保證積極向上不斷學(xué)習(xí)
————————————————
版權(quán)聲明:本文為CSDN博主「彬小二」的原創(chuàng)文章,遵循 CC 4.0 BY-SA 版權(quán)協(xié)議,轉(zhuǎn)載請(qǐng)附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/qq_39884947/article/details/86609930
標(biāo)簽:
python
ip
代理
防止
上傳時(shí)間:
2019-11-15
上傳用戶:fygwz1982
-
This research work aims at eliminating the off-chip RF SAW filters from fre-
quency division duplexed (FDD) receivers. In the first approach, a monolithic passive
RF filter was constructed using on-chip capacitors and bondwire inductors. The bond-
wire characteristics were studied in details and the effect of mutual inductive coupling
between the bondwires on the filter performance was analyzed. Based on that, a bond-
wire configuration was proposed to improve the frequency Response of the filter. The
filter was implemented in 0.18 μm CMOS process for WCDMA applications.
標(biāo)簽:
Interference
Mitigation
Techniques
上傳時(shí)間:
2020-05-27
上傳用戶:shancjb
-
The first question most readers of an O’Reilly book might ask is about the choice of the
cover animal. In this case, “why a duck?” Well, for the record, our first choice was a
unicorn decked out in glitter and a rainbow sash.
That Response always gets a laugh (we are sure you just giggled a little), but it also brings
to the surface a common perception of software-defined networks among many expe‐
rienced network professionals. Although we think there is some truth to this perception,
there is certainly more meat than myth to this unicorn.
標(biāo)簽:
Networks
Software
Defined
SDN
上傳時(shí)間:
2020-06-01
上傳用戶:shancjb
-
It has been said that the move from narrowband to broadband access is the second
revolution for the Internet — ‘broadband is more bandwidth than you can use’.
Once users have experienced broadband access there is no turning back. A whole
new world of applications and services becomes possible. No longer is it the ‘world-
wide wait’. The speed of Response and visual quality enabled by broadband finally
allows the Internet to reach its true potential.
標(biāo)簽:
Digital
Home
上傳時(shí)間:
2020-06-06
上傳用戶:shancjb
-
n its Framework and Roadmap for Smart Grid Interoperability Standards, the US
National Institute of Standards and Technology declares that a twenty-first-century
clean energy economy demands a twenty-first-century electric grid. 1 The start of the
twenty-first century marked the acceleration of the Smart Grid evolution. The goals
of this evolution are broad, including the promotion of widespread and distributed
deployment of renewable energy sources, increased energy efficiency, peak power
reduction, automated demand Response, improved reliability, lower energy delivery
costs, and consumer participation in energy management.
標(biāo)簽:
Communication
Networks
上傳時(shí)間:
2020-06-07
上傳用戶:shancjb
-
n present power system, the engineers face variety of challenges in
planning, construction and operation. In some of the problems, the engineers need
to use managerial talents. In system design or upgrading the entire system into
automatic control instead of slow Response of human operator, the engineers need
to exercise more technical knowledge and experience. It is principally the engi-
neer’s ability to achieve the success in all respect and provide the reliable and
uninterrupted service to the customers. This chapter covers some important areas
of the traditional power system that helps engineers to overcome the challenges. It
emphasizes the characteristics of the various components of a power system such
as generation, transmission, distribution, protection and SCADA system. During
normal operating conditions and disturbances, the acquired knowledge will pro-
vide the engineers the ability to analyse the performance of the complex system
and execute future improvement
標(biāo)簽:
Smart
Grids
上傳時(shí)間:
2020-06-07
上傳用戶:shancjb
-
Multisim官方示例Multisim仿真例程基礎(chǔ)電路范例135例合集:Chapter 1 - RLC CircuitsChapter 2 - DiodesChapter 3 - TransistorsChapter 4 - AmplifiersChapter 5 - OpampsChapter 6 - FiltersChapter 7 - Miscellaneous CircuitsFundamental Circuits.pdf004 Parallel DC Circuits.ms10005 Series-Parrallel DC Circuit.ms10006 Current Analysis.ms10007 Millmans Theorem 1.ms10008 Millmans Theorem 2.ms10009 Kirchhoff's Current Law.ms10010 Thevenin's Theorem.ms10011 Superposition Principle.ms10012 Nortons Theorem and Source Conversion.ms10013 AC Voltage Measurement.ms10014 Frequency Response of the Series RL Network.ms10015 RL High and Low Pass Filter.ms10016 Frequency Response of the Series RC Network.ms10017 RC High and Low Pass Filter.ms10019 Center-Tapped Full-Wave Rectifier.ms10020 Bridge Rectifier.ms10021 Capacitor-Input Rectifier Filter.ms10022 Diode Clipper (Limiter).ms10023 Diode Clipper.ms10024 Diode Clamper (DC Restorer).ms10025 Diode Voltage Doubler.ms10026 Zener Diode and Voltage Regulation 1.ms10027 Zener Diode and Voltage Regulation 2.ms10028 Zener Diode and Voltage Regulation 3.ms10105 TTL Inverter.ms10107 TTL Gate.ms10109 OR Gate Circuit.ms10111 Over-Damp Circuit.ms10113 Critical-Damp Circuit.ms10115 Series RLC Circuit 1.ms10117 Clapp Oscillator.ms10119 Differential Amplifier 1.ms10121 Differential Amplifier in Common Mode.ms10123 LC Oscillator with Unity Gain Buffer.ms10125 Notch Filter.ms10127 PNP Differential Pair.ms10129 Crossover Network.ms10131 Second-Order High-Pass Chebyshev Filter.ms10133 Third-Order High-Pass Chebyshev Filter.ms10135 Fifth-Order High-Pass Filter.ms10
標(biāo)簽:
multisim
上傳時(shí)間:
2021-10-27
上傳用戶:trh505
-
對(duì)某四輪獨(dú)立驅(qū)動(dòng)電動(dòng)汽車輪轂電機(jī)進(jìn)行研究,設(shè)計(jì)一種永磁無(wú)刷直流電機(jī)控制器.以STM32F103RBT6芯片為基礎(chǔ),對(duì)電機(jī)驅(qū)動(dòng)電路、采樣電路和保護(hù)電路分別進(jìn)行硬件設(shè)計(jì)與分析;同時(shí),采用模塊化軟件設(shè)計(jì)方案,對(duì)該控制器的軟件系統(tǒng)進(jìn)行升級(jí).實(shí)驗(yàn)驗(yàn)證表明:所設(shè)計(jì)的電機(jī)控制器能使電機(jī)響應(yīng)迅速、轉(zhuǎn)速穩(wěn)定、無(wú)超調(diào),且電動(dòng)車動(dòng)力輸出性能良好.A permanent magnet brushless direct current motor controller was designed by studying the hub motor of a four-wheel independent drive electric vehicle.Based on STM32 F103RBT6 chip,the hardware design and analysis of motor drive circuit,sampling circuit and protection circuit were carried out respectively.At the same time,modular software design scheme was adopted to upgrade the software system of the controller.Experimental results show that the designed motor controller can ensure the motor fast Response,stable speed,no overshoot,and good power output performances.
標(biāo)簽:
電動(dòng)汽車
永磁無(wú)刷直流電機(jī)
上傳時(shí)間:
2022-03-26
上傳用戶:qingfengchizhu
-
隨著電磁閥在工業(yè)和日常應(yīng)用的增多,其功耗越來(lái)越被人們所重視。通過(guò)對(duì)電磁閥驅(qū)動(dòng)電路的研究,設(shè)計(jì)一套電磁閥節(jié)能驅(qū)動(dòng)電路。不僅提高了電磁閥的響應(yīng)時(shí)間,更重要的是降低了功耗,使電磁閥由工作在大電流狀態(tài)下,變成大電流啟動(dòng)小電流維持的工作狀態(tài)。減少了由電流過(guò)大引起的電磁閥線圈過(guò)熱,增加了電磁閥的安全性。The power consumption of an electromagnetic valve is drawing increasingly more attentiori as it is widely used in industrial production and daily life. In this study, an energy - saving driving circuit of electromagnetic valves was designed. It can make an electromagnetic valve to start with a high current while work with a low current; thereby the power consumption can be reduced. Besides, it can shorten the Response time of an electromagnetic valve and improve the security of the valve.
標(biāo)簽:
電磁閥
節(jié)能驅(qū)動(dòng)電路
上傳時(shí)間:
2022-04-16
上傳用戶:
-
以STM32F103C8T6為核心,設(shè)計(jì)了無(wú)刷直流電機(jī)控制器硬件電路。電路主要包括IR2310構(gòu)成的PWM驅(qū)動(dòng)電路、IRF3808構(gòu)成的逆變電路、增量式旋轉(zhuǎn)編碼構(gòu)成的速度反饋電路。控制器具有CAN和RS232通信接口,可與計(jì)算機(jī)或PLC構(gòu)成速度或位置伺服系統(tǒng)。利用由xPC目標(biāo)搭建的半實(shí)物仿真平臺(tái)對(duì)PI參數(shù)進(jìn)行整定。測(cè)試了控制器的速度伺服響應(yīng)性能,給定速度為2400rpm時(shí),控制器響應(yīng)時(shí)間為0.32s。實(shí)驗(yàn)結(jié)果表明,系統(tǒng)工作可靠,穩(wěn)定性好,響應(yīng)速度快,可以滿足上肢康復(fù)機(jī)器人的機(jī)械臂速度控制性能要求。The hardware circuit of Brushless DC motor controller is designed by taking STM32F103C8T6 as the core,which mainly includes PWM driving circuits made up of IR2310,inverter circuit formed by IRF3808,speed feedback circuit composed of incremental rotary encoder and so on.Speed servo control system or position servo control system can be composed of BLDM controller with computer or PLC through CAN communication interface or RS232 serial communication interface.By using the hardware in the loop simulation platform built by xPC target,the PI parameters are set up.The Speed servo Response performance of the controller is tested.When the speed is 2 400 rpm,the Response time of the controller is 0...
標(biāo)簽:
stm32
無(wú)刷直流電機(jī)
上傳時(shí)間:
2022-05-07
上傳用戶: