Als ich versuchte, intern mit Python zu kratzen, bekam ich [Errno 11001].
Wird durch Angabe eines Proxys behoben.
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":["","Januar","Februar","März","April","Kann","Juni","Juli","August","September","Oktober","1Januar","1Februar"],"wgMonthNamesShort":["","Januar","Februar","März","April","Kann","Juni","Juli","August","September","Oktober","1Januar","1Februar"],"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":["Artikel mit ungültigen Quellen/2018","Objektorientierte Sprache","Skriptsprache","Quelloffene Software","Python","Grundlegende Informationstechnikerprüfung"],"wgPageContentLanguage":"ja","wgPageContentModel":
・ ・ ・
Recommended Posts