Тёмный

How to Rotate Proxies with Python 

John Watson Rooney
Подписаться 89 тыс.
Просмотров 122 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 199   
@Tips4Tat
@Tips4Tat 3 года назад
Great video. I think 3 things are REALLY worthy of note because the answer to the failures isn't necessarily that the proxies were blocked: - Sometimes the proxies weren't able to be connected to in the first place - Sometimes the Server can't handle so many back to back requests AND Some proxies are set up by malicious actors to gain unauthorized access to connecting hosts.
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
Yes absolutely, great comments thank you for sharing
@anewmanvs
@anewmanvs 3 года назад
Also make sure to use elite proxies as the others still make your ip visible in the headers and therefore ip origin is known by the host
@IPCOLA-
@IPCOLA- 11 месяцев назад
Try ipcola, residential IP proxy, sticky and rotation sessions,100% new, 99% pure
@marxlenin8523
@marxlenin8523 2 года назад
Ive been binging your content because of an amazon scraper I'm working on. Can't help but giggle at the consistent struggle you have in typing "requests" All in good fun! Keep up the great content!
@JohnWatsonRooney
@JohnWatsonRooney Год назад
Haha thanks. I’m better now but typing and talking at the same time makes more mistakes!!
@marxlenin8523
@marxlenin8523 Год назад
@@JohnWatsonRooney the only multitasking I do is copy what you type while trying to understand the concept/s behind it, which you have done exceptionally well. Thanks for being a virtual tutor, John! (Still having issues with bot detection with my bs4+requests, tried time.sleep and randomizing user agent with the fake user agent library, though)
@irfanshaikh262
@irfanshaikh262 2 года назад
9:28 this part changed my programming outlook to drastic extent. The wonders you can pull using the threaded approach is just sublime. Thanks John once again. It seems im running out of gratitudes to give you the due credit.
@chizzlemo3094
@chizzlemo3094 3 года назад
Nice to see a video where I understand everything first time! Thanks
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
Thank you!
@hypebeastuchiha9229
@hypebeastuchiha9229 2 года назад
Every time I have a python scraping problem I search your name Great channel mate 👍
@JohnWatsonRooney
@JohnWatsonRooney 2 года назад
Thank you very kind!
@RS-Amsterdam
@RS-Amsterdam 3 года назад
Thanks to the man who has all the answers to my questions. Man, you have the well of wisdom on behalve of scraping/python, JSON and what matters in that field. Although I am a pro IT guy for many many years (PM, Consultant, Architect and Advisor) this field of expertise is rather unexplored for me, but following your video's made it crystal clear to me. Thanks again for sharing
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
Thank you! Very kind
@TECHWIZARD137
@TECHWIZARD137 Год назад
Checked more than 10 videos, all videos are awesome Thanks Bro
@Pre.cadaver
@Pre.cadaver 2 года назад
Beautiful content as always! I tried scraping the site in this video using bs4 as it's the only framework I know as of now. I hope you make a video on scraping this site as you said in the video.
@abhinavshah138
@abhinavshah138 4 года назад
Super Insightful, John! Thank you for sharing this one 🙌
@irfankalam509
@irfankalam509 4 года назад
Thanks for this video and looking forward to your future video about working proxies which are useful for web scraping
@martpagente7587
@martpagente7587 4 года назад
Thankyou John! It's getting more interesting everytime you upload videos. By the way, can you start using Request+BeautifulSoup+Splash sooner in the future, especially in setting up? I'm have a couple of questions for you next Q&A series, I'm excited!
@JohnWatsonRooney
@JohnWatsonRooney 4 года назад
Thanks Mart!
@ales3679
@ales3679 3 года назад
@@JohnWatsonRooney Hello, How do I format the proxies in a list? Do I need to use a .csv format? Or can I just use a .txt file. Thanks!
@ServetGulnaroglu
@ServetGulnaroglu 3 года назад
That was what I exactly looking for
@lightblue254
@lightblue254 Год назад
Thanks chief, informative and easy to understand tutorial
@ghaithmoe9573
@ghaithmoe9573 4 года назад
This trick saved my time. Thank you 🙌🏾
@ghaithmoe9573
@ghaithmoe9573 3 года назад
@Bryan Braydon to be honest I don't care.
@bandyco
@bandyco 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AL9Hcq15R5s.html
@sheikhakbar2067
@sheikhakbar2067 3 года назад
Thanks; very helpful and unique tutorial; more like this, please!👍
@ZhCrypto
@ZhCrypto 2 года назад
you deserve Millions of subscribers❤❤
@АртемКоваленко-э7ж
Great Explanetion. Thank you!
@devanshn6895
@devanshn6895 3 года назад
Loved the way you explain, this is the first time I've came across your content and I enjoyed learning every second, Will this script be also applicable for socks5 proxy?
@MorganDavis1
@MorganDavis1 Год назад
Thanks! Do you know any services with rotating proxies that rotate every 60 seconds and were you can choose mix geo or a specific country? I have mine from proxy-stоrе but this is my first service, want to have cheap alternatives and to find out other options
@celerystalk390
@celerystalk390 4 года назад
New skill learned. Thank you as always!
@emantbr5866
@emantbr5866 3 года назад
This video was really helpful. Thank you for your videos!
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
You’re welcome glad you enjoyed it!
@MaloneMatty
@MaloneMatty 3 года назад
Hey John, I am a Uni student studying Data Analytics. Currently doing a unit on "Data Acquisition" and your videos are far better walking through the complexities of web scraping than this current course! I'm doing enough web scraping now where I think it is beneficial for me to start looking at paid for rotating residential proxies. Do you have a service that you recommend? Even if you have affiliate links. If you don't have any links, I think it would be beneficial to seek out such sponsorship possibilities soon.
@juliopaniagua8723
@juliopaniagua8723 3 года назад
Hey John! new subscriber here..! Im enjoying your channel very much, I have one suggestion though, in most of your videos you refer to previous ones and say that you're going to post the links somewhere but you don't. As a newcomer it is a bit difficult to find the video you're referring to since well your thumbnails and titles are in general, similar. Links will help new subscribers drive through your content smoothly. Cheers!
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
Hi - sure no problem I know I have a bad habbit of not adding in links when i said i would!
@zajaguar
@zajaguar 2 года назад
Hi John, great video and thank you for your time and effort for creating these videos for us. I was wondering if you added the updated version of this video as you mentioned because I could not find any other tutorial on proxy on your site.
@umacalopsitaeumviolao
@umacalopsitaeumviolao 3 года назад
I'm quite familiar with using selenium. But I gotta say, the way you explain requests is very didatic.
@YatharthRaut
@YatharthRaut 3 года назад
Hey! thank you for such a detailed video. Is it possible for me to skip Captchas by rotating working proxies on a website? Or is there a more efficient method to do it?
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
I think so yes. It's important to have working proxies but also to act like a real user as much as possible - use complete and real headers, don't send to many requests and rotate through proxies in randomly, not in an order
@RenatoEsquarcit
@RenatoEsquarcit 3 года назад
Brilliant job John... Do you guys manage to scrape more or less all sort of websites or there are some impossible ones?
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
Some are definitely harder than others but there is always a way!
@RenatoEsquarcit
@RenatoEsquarcit 3 года назад
@@JohnWatsonRooney I'll keep trying then! 😉
@nelsongomez8547
@nelsongomez8547 2 года назад
Congrats John, it amazing video :) Regards, Nelson
@JohnWatsonRooney
@JohnWatsonRooney 2 года назад
Thanks Nelson!
@hippolytesucche744
@hippolytesucche744 4 года назад
Nice video but how can you deal with auth proxies?
@AbuTuraab72
@AbuTuraab72 3 года назад
use selenium wire
@snopz
@snopz 2 года назад
proxies = { 'https' : 'user:password@proxyip:port' } r = requests.get('url', proxies=proxies)
@bagia1000
@bagia1000 3 года назад
when i choose a proxy and print the status code, it returns 200, but when I want to show the json, it returns exception. why?
@wuhanuniversity
@wuhanuniversity 2 года назад
It's really helping material. Thanks dear professor
@lucifervns
@lucifervns 3 года назад
Hello even request.get response value 200 for a url and it looks like proxy is working but when we load a this website etc then it's always show can't access, load timeout,rendering timeout..etc. So do we have any way to check those proxy could work as normal? Thank you so much
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
Unfortunately most free proxies are blocked from the main websites so that could be your issue. You can try to find some that do work but in my experience it can be tough
@jonnyarmani1
@jonnyarmani1 4 года назад
Great content hoss, new fan here for sure!
@matt-i3r6w
@matt-i3r6w 3 дня назад
How can you handle retries with a request? If one request fails how to retry with a different proxy?
@jonathanfriz4410
@jonathanfriz4410 4 года назад
Hi John, all your content is very helpfull like always. Can you make, well I supposed is possible. When you're scraping some site and after a few requests you get block or ask for some verification code, can you skip that current proxys and get another proxys from list of proxys? thank you!
@JohnWatsonRooney
@JohnWatsonRooney 4 года назад
Hi Jonathon. Sure that is very possible - instead of trying to handle the error of gettgin blocked i would jsut rotate through each proxy for each new request. You can spread the load out that way
@jonathanfriz4410
@jonathanfriz4410 4 года назад
@@JohnWatsonRooney Thank you I will try that. I often get blocked by a page even when i make high sleep times.
@taczankov13g
@taczankov13g 2 года назад
Couldn't agree more!
@ugurdev
@ugurdev 3 года назад
I had the below error, and solved it by going into the documentation and used the example under proxies to setup the proxies. Maybe the requests library changed a bit since. "requests.exceptions.InvalidURL: Proxy URL had no scheme"
@kienletrung2840
@kienletrung2840 2 года назад
Hi, I'm having the same problem... Were you able to solve it?
@trustedapp6532
@trustedapp6532 3 года назад
Hello john , video is outstanding as usual,my question is can we use same method for request_html library
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
Yes you can!
@ali5t4ir
@ali5t4ir 2 года назад
Thanks John for yet another useful video - I'm new to web scraping & have been blocked from a site I want to scrape, I was wondering & Im sure there are packages out there to save the full content of a website locally so we can scrape with no issues & Im not talking about big sites such as Amazon - do you think this is possible if so why no one else is talking about it? how would you go about it please?
@whyamihere1235
@whyamihere1235 Год назад
Hello, is there a way to make it so the proxies are constantly changing via a api?? For example you have a 10k list of proxies with numerous sources, but the proxies get updated every 5 minutes
@JohnWatsonRooney
@JohnWatsonRooney Год назад
Not entirely sure what you mean but if you can request a proxy list, store them and use them for a few minutes, the request again and update that would work. Easiest solution would be to download the proxy list every 5 mins and store in a file, and use that file to import new proxies into your scraper
@whyamihere1235
@whyamihere1235 Год назад
@@JohnWatsonRooney would that way work without stopping the instance??
@emPrata
@emPrata 2 года назад
Excelent !!!! Very Nice Video John !!!!
@JohnWatsonRooney
@JohnWatsonRooney 2 года назад
Thank you!
@nandafadhli869
@nandafadhli869 Год назад
Hi John, do you have any recommendation of the best paid proxy provider?
@sayyadsalman9132
@sayyadsalman9132 4 года назад
Thank you john. It was really helpfull!
@bandyco
@bandyco 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AL9Hcq15R5s.html
@kaverianuranjana9787
@kaverianuranjana9787 3 года назад
you said that the proxies will not work for Google but do you think they will work for other GCP products?
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
You can try but probably not- these free proxies are generally abused and are black listed for almost everywhere
5 месяцев назад
Great video! Any idea how to fix SSL: CERTIFICATE_VERIFY_FAILED?
@alexpresley8002
@alexpresley8002 Год назад
Nice ❤ Thank you 🙏
@nachoeigu
@nachoeigu 2 года назад
Is secure to use a free proxy page? In terms of cybersecurity I mean. Thank you
@JohnWatsonRooney
@JohnWatsonRooney 2 года назад
don’t send any personal or sensitive information over it but otherwise yes
@greis790
@greis790 4 года назад
Can i ask something, with this technique we can still use Session from Requests to scrape faster?? or by using proxies we have to establish a new connection with the server from the start with every request?
@JohnWatsonRooney
@JohnWatsonRooney 4 года назад
Yeah that’s right, the proxy only changes your ip on each separate request - so if you are using a session it wouldn’t work, you have to create a new connection each time
@greis790
@greis790 4 года назад
@@JohnWatsonRooney Thanks a lot!! your videos are very nice and meaningful!
@dennistanui7085
@dennistanui7085 3 года назад
Hello John, awesome video, does the same method work with SOCKS4/SOCKS5 proxies with pysocks??
@ShadowFlamme
@ShadowFlamme 4 года назад
Amazing tutorial :) good job
@TheBlackWarriorLP
@TheBlackWarriorLP 3 года назад
Can i use this method with residential proxies or datacenter?
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
Yes absolutely
@smoothsteel
@smoothsteel Год назад
Thanks so much for this video, I've had alot of problems with rate limits thank you John Watson Rooney
@JohnWatsonRooney
@JohnWatsonRooney Год назад
No worries!
@funnypuppy8557
@funnypuppy8557 3 года назад
Hi John ,why result of crapeProxy is no port ?
@krolyn34
@krolyn34 3 года назад
Thanks for this video. I'm using requests_html for my scrapper, do you know what is the equivalent of (print(r.json)) ? I'd like to be sure that the scrapper is using the right proxy. Thank you!
@mehdismaeili3743
@mehdismaeili3743 2 года назад
Excellent. thanks.
@doggo104
@doggo104 3 года назад
Great video! How would I go about getting the equivalent of a r.json response (What IP used is what I want to know) when targeting a URL like Google for example, where the .json will not work?
@usr829
@usr829 5 месяцев назад
Hi John, please make a video on how to scrape aliexpress
@XELTRA1
@XELTRA1 3 года назад
i try your code, the problem is 2:59, the response is 200, when i use print(r.json) there is error so go to except, but without json, proxylist show working, please tell me why print(r) and print(r.json) are different result
@ΠΑΝΑΓΙΩΤΗΣΓΑΤΙΔΗΣ-τ4δ
I'm doing a bot traffic,and in authentication (log-in) i get a 429 error....I try to put some delays but nothing happent..Do you have any idea?
@robertdonald943
@robertdonald943 3 года назад
you are the bets thank you so much
@inhtoan2700
@inhtoan2700 Год назад
Thanks you so much❤
@komogg
@komogg 2 года назад
why my {'origin': 'myip'} just showing my real ip
@erenc8377
@erenc8377 2 года назад
I couldn't find any working proxies on that list. So, I created my own proxy pool, hahahah
@JohnWatsonRooney
@JohnWatsonRooney 2 года назад
That’s a good idea!
@atultanna
@atultanna 2 года назад
Proxy pool can you guide us
@kaoutharmokrane775
@kaoutharmokrane775 3 года назад
I'm currently scraping Facebook with Selenium for my final project. (I can't use the API for many reasons and I can't change the source as my project depends solely on facebook: if you're going to say it's illegal) I switch user-agents but should I use proxy too? I get blocked quite often and I'm fairly new to this.
@cl3mzer92
@cl3mzer92 2 года назад
Totally agree, bro!
@preetisvlog731
@preetisvlog731 3 года назад
great explanation. How can I used this code to rotate proxies in my existing file of scraped data?
@sushilpotdar5371
@sushilpotdar5371 Год назад
Great video. Thanks. How to add the RU-vid video link in this code ?
@reyhanfikri9295
@reyhanfikri9295 3 года назад
It's really helpful John. I just wanna ask, is it possible if we use openVPN, thank you. I just wondering openVPN for requesting, I think it could be awesome, please.
@oneanime5551
@oneanime5551 3 года назад
did u have any luck?
@wangdanny178
@wangdanny178 2 года назад
thanks for your video. so is it possible to rotate headers?
@programmingpictures4420
@programmingpictures4420 3 года назад
really informative video.... but is it possible to use proxy for python program or module?.... i mean, can i use proxy for smtplib python module etc?..... sir, if you have any solution or reference please tell me.....
@ahmedabdulrazzaq2015
@ahmedabdulrazzaq2015 2 года назад
How do you approach creating a bulk Instagram account? No API is available to create an account only way is scripting in the browser.
@ujjawalgarg561
@ujjawalgarg561 2 года назад
Great Video. I tried to use a proxy available online and returned back with a 200 status code. But if then try to print the text (page.text), I get a nonetype object. Can you help me why this would be a case
@JohnWatsonRooney
@JohnWatsonRooney 2 года назад
Sounds like the proxy works but is being detected by the website. Can you print anything, like a title or something?
@shayanhdry6224
@shayanhdry6224 2 года назад
thanks that was awesome thank you do you suggest any method for searching around 20000 words in a day in google and get the results? without getting blocked?
@whitecastlept
@whitecastlept 2 года назад
What if i want to send a POST instead of get, how can i use proxies with post ?
@jaspalpatel4506
@jaspalpatel4506 2 года назад
how to use proxy and open 5 chrome browser at same time with different proxy and give individual task to them?
@omarmahmoud2087
@omarmahmoud2087 3 года назад
This trick will help me to change my IP address continuously after a while to prevent google from blocking me to request?
@ryufps1
@ryufps1 2 года назад
Hey bro, how are u? I'm looking to buy a rotate proxy ip, would you know where you have it?
@lukehamilton8179
@lukehamilton8179 2 года назад
I know this video is specifically about requests, but can this be done using normal Selenium? I know the HOST:PORT proxy configuration for Selenium works, but can Selenium proxies be configured using a proxy network configuration (USER:PASSWORD@PROXY:PORT)? From my research, questions on the internet, and support tickets with Chrome Driver and Selenium, it sounds like this isn't possible:
@engineerbaaniya4846
@engineerbaaniya4846 4 года назад
Really helpful 👍
@girlxzonlineshopping977
@girlxzonlineshopping977 3 года назад
thanks for your sharing ,how can i come out the proxy:port????thank you again
@hervesimon8728
@hervesimon8728 3 года назад
i got this error "requests.exceptions.ProxyError: HTTPSConnectionPool Max retries exceeded with url: /ip (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(54, 'Connection reset by peer')))" with every proxies i use. plese help me
@ПродюсерМсКлоуна
@ПродюсерМсКлоуна 2 года назад
thank you very much
@kerry-annemmartin1919
@kerry-annemmartin1919 Год назад
There are two IP addresses one is identification of the device and the other identified the ISP ip
@KhalilYasser
@KhalilYasser 4 года назад
Thank you very much for this amazing tutorial. As for the code of scraping proxies, I tried to export the proxylist to csv file and it is ok, but I noticed that the value 0 is on the first row ( I recognize that this is the index of the column of the dataframe from pandas package). I tried searching how to get rid of this index of column but there is no luck. How can I get rid of the index of column of the dataframe df = pd.DataFrame(proxylist) df.to_csv('Table.csv', encoding='utf-8', index =False) This works for the indexing of rows not for the columns.
@yellowtruffles
@yellowtruffles 3 года назад
great tutorial. How do i make it work with auth proxies and get them to display their speed besides showing that the proxies work?
@bandyco
@bandyco 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-AL9Hcq15R5s.html
@KennyTrades
@KennyTrades 3 года назад
Hello John, I am trying to implement this code with a list of proxies that already work in a csv file and the code runs without any errors but does not give me an outcome whatsoever. I believe my issue is originating from the extract function and I was hoping you could lend me a hand if that is possible. I am looking forward to the sequel of this video you said you would make so I can further understand. Thank you
@ixypsylongaming
@ixypsylongaming 3 года назад
How does your extract function looks like?
@terryterry1655
@terryterry1655 Год назад
Can proxies be used in youtube autobot?
@JohnWatsonRooney
@JohnWatsonRooney Год назад
Yea, anywhere you make a http request you can use them
@akalamian
@akalamian 3 года назад
fully watch this video twice, but honestly in the video no coding is about "how to rotate proxies', can you make video truly about 'rotate'?
@JohnWatsonRooney
@JohnWatsonRooney 3 года назад
I didn’t make that part super clear, I am planning on revisiting proxy usage and will cover it better next time
@akalamian
@akalamian 3 года назад
@@JohnWatsonRooney thank you John, looking forward to it
@kmfayez8225
@kmfayez8225 4 года назад
Can i work on US survey website by buying proxies and rotate them?
@JohnWatsonRooney
@JohnWatsonRooney 4 года назад
Yes.. probably. Technically it could work but I assume survey websites have some good blocker software to stop automated work
@atultanna
@atultanna 2 года назад
Can we create a proxy script Purpose is to use them for scrapebox
@lucifervns
@lucifervns 3 года назад
Thank you
@PinguLovesU
@PinguLovesU 4 года назад
this was very, good but i need something such as how to do this with selenium
@JohnWatsonRooney
@JohnWatsonRooney 4 года назад
It's possible, the downside is as far as i am aware you need to close the browser and start a new one each time you rotate through the proxy. Adds a lot of time
@dobcs3236
@dobcs3236 8 месяцев назад
thank you
@funnypuppy8557
@funnypuppy8557 3 года назад
Tks John
@heidik1757
@heidik1757 2 года назад
Mine keeps failing... any ideas why? Good video!
@KhalilYasser
@KhalilYasser 4 года назад
I have tried so much proxies and I didn't find a working one. What's the best approach to get a working proxy? .. Another question: I have tried my ip address and the port and tried as a proxy but got failed too !!!
@JohnWatsonRooney
@JohnWatsonRooney 4 года назад
The free ones never really seem to work! unfortunately I believe you need to use a paid service and It's something I want to check out in the future, but haven't used right now
@KhalilYasser
@KhalilYasser 4 года назад
@@JohnWatsonRooney I just need two proxies that are working to test the codes. Can you lend me two only :)?
@atultanna
@atultanna 2 года назад
@@JohnWatsonRooney try making a proxy script
@kerry-annemmartin1919
@kerry-annemmartin1919 Год назад
Why would you say there is only one ip
@tomcrowhurst7418
@tomcrowhurst7418 3 года назад
For some reason this script just returns my ip address not the proxy address?
@Mehrdadkh87
@Mehrdadkh87 Год назад
Where could i buy proxies?
@JohnWatsonRooney
@JohnWatsonRooney Год назад
there's a link in the description for the proxies I use
@Mehrdadkh87
@Mehrdadkh87 Год назад
@@JohnWatsonRooney thx
@Breadurite
@Breadurite 2 года назад
How do I do this with proxies that use a username and password
Далее
This is How I Scrape 99% of Sites
18:27
Просмотров 129 тыс.
Rotating Proxies For Web Requests in Python
11:31
Просмотров 83 тыс.
Web Scraping with Python - Start HERE
20:58
Просмотров 37 тыс.
Industrial-scale Web Scraping with AI & Proxy Networks
6:17
This Is Why Python Data Classes Are Awesome
22:19
Просмотров 810 тыс.
How I MASTERED CODING with these 4 easy steps
8:02
Просмотров 107 тыс.
Web Scraping with Professional Proxy Servers in Python
32:26
The Biggest Mistake Beginners Make When Web Scraping
10:21
My 10 “Clean” Code Principles (Start These Now)
15:12