When you get an error in python scraping (requests)

About [Errno 11001]

When I tried to scrape using python in-house, [Errno 11001] came out.

Resolved by specifying a proxy.

import requests
from bs4 import BeautifulSoup

proxies = {
'http': 'http://123.45.678.000:0000',
'https': 'http://123.45.678.000:0000',
}

url = 'https://ja.wikipedia.org/wiki/Python'
res = requests.get(url, verify=False, proxies=proxies)
soup = BeautifulSoup(res.text)

soup
<!DOCTYPE html>
<html class="client-nojs" dir="ltr" lang="ja">
<head>
<meta charset="utf-8"/>
<title>Python - Wikipedia</title>
<script>document.documentElement.className="client-js";RLCONF={"wgBreakFrames":!1,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"ja","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","1January","1February"],"wgMonthNamesShort":["","January","February","March","April","May","June","July","August","September","October","1January","1February"],"wgRequestId":"XhwEyQpAICIAABeLnhMAAADL","wgCSPNonce":!1,"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":!1,"wgNamespaceNumber":0,"wgPageName":"Python","wgTitle":"Python","wgCurRevisionId":75653560,"wgRevisionId":75653560,"wgArticleId":993,"wgIsArticle":!0,"wgIsRedirect":!1,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Articles containing invalid sources/2018","Object-oriented language","Scripting language","Open source software","Python","Basic Information Technology Engineer Examination"],"wgPageContentLanguage":"ja","wgPageContentModel":

・ ・ ・

Recommended Posts

When you get an error in python scraping (requests)
What to do if you get an error when importing matplotlib in Python (Mac)
I get an Import Error in Python Beautiful Soup
I get an error when I put opencv in pyautoGUI
What to do if you get an error when installing python with pyenv
[Python] What to check when you get a Unicode Decode Error in Django
What to do if you get an OpenSSL error when installing Python 2 with pyenv
Resolved an error when putting pygame in python3 on raspberry pi
When I get an error with Pylint in Atom on Windows
When I get an error with PyInstaller
Solution if the module is installed in Python but you get an error in Jupyter notebook
What to do if you get an error when running "certbot renew" in CakePHP environment
What to do if you get an error when trying to load mnist
What to do if you get an error when installing Dlib (Ubuntu)
When I get a chromedriver error in Selenium
[python] [vscode] When you get angry with space-tab-mixed
Error when trying to install psycopg2 in Python
Get date in Python
I get an error when I put a Python plugin in Visual Studio Code under the pyenv environment
Workaround if you get an error when trying to install PySide with pip
[Python] I want to know the variables in the function when an error occurs!
In the Chainer tutorial, I get an error when importing a package. (mock)
I got an error when I put opencv in python3 with Raspberry Pi [Remedy]
[python] What to do when an error occurs in send_keys of headless chrome
If you get a long error when tabbing an interactive shell with Anaconda
What to do if you get an error when trying to send a message in tasks.loop () immediately after startup
I get an error when trying meinheld + WebSocket + mongodb
If you encounter a "Unicode Decode Error" in Python
What to do if you get an Import Error when importing matplotlib with Jupyter
I get an error when I try to raise Python to 3 series using pyenv on Catalina
What to do if you run python in IntelliJ and end with an error
Get YouTube Comments in Python
Quicksort an array in Python 3
Scraping with selenium in Python
Get last month in python
[Python] Scraping in AWS Lambda
Scraping with chromedriver in python
Scraping with Selenium in Python
Scraping with Tor in Python
Get Terminal size in Python
Explicitly get EOF in python
Attention when os.mkdir in Python
Slice error in python (´ ; ω ; `)
Get Evernote notes in Python
Get Japanese synonyms in Python
You will be an engineer in 100 days --Day 27 --Python --Python Exercise 1
You will be an engineer in 100 days --Day 34 --Python --Python Exercise 3
I got an error in vim and zsh in Python 3.7 series
You will be an engineer in 100 days --Day 31 --Python --Python Exercise 2
What to do when you get an error saying "Name resolution temporarily failed" on linux
Check the argument type annotation when executing a function in Python and make an error
What to do if you get Swagger-codegen in python and Import Error: No module named
When Runtime Error: maximum recursion depth exceeded while pickling an object appears in python pickle
What to do if you get an Undefined error when trying to use pip with pyenv
Get Leap Motion data in Python.
[python] Error when installing library ramkan
[Subprocess] When you want to execute another Python program in Python code
If you get Error: That port is already in use. In Django
Precautions when using pit in Python
If you get stuck in Cannot load mkl_intel_thread.dll in Python on Windows
Error when building mac python environment