Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何访问站点';谁的申请证书?_Python_Web Scraping_Python Requests - Fatal编程技术网

Python 如何访问站点';谁的申请证书?

Python 如何访问站点';谁的申请证书?,python,web-scraping,python-requests,Python,Web Scraping,Python Requests,在Python3中,我访问一个带有请求的站点,以进行抓取: from bs4 import BeautifulSoup import requests res = requests.get('https://esaj.tjsp.jus.br/cposg/search.do?conversationId=&paginaConsulta=1&localPesquisa.cdLocal=-1&cbPesquisa=NMPARTE&tipoNuProcesso=UNIF

在Python3中,我访问一个带有请求的站点,以进行抓取:

from bs4 import BeautifulSoup
import requests

res = requests.get('https://esaj.tjsp.jus.br/cposg/search.do?conversationId=&paginaConsulta=1&localPesquisa.cdLocal=-1&cbPesquisa=NMPARTE&tipoNuProcesso=UNIFICADO&dePesquisa=Alex+Spinelli+Manente&chNmCompleto=true&uuidCaptcha=')
但是错误出现了:

SSLError: HTTPSConnectionPool(host='esaj.tjsp.jus.br', port=443): Max retries exceeded with url: /cposg/search.do?conversationId=&paginaConsulta=1&localPesquisa.cdLocal=-1&cbPesquisa=NMPARTE&tipoNuProcesso=UNIFICADO&dePesquisa=Alex+Spinelli+Manente&chNmCompleto=true&uuidCaptcha= (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)'),))
我知道我需要现场证书,对吗

请问,我如何下载网站的证书?我把它另存为。pem分机


如何使用检查选项指向此文件?

问题不在于如何获取站点的证书。该网站在每次握手时都会向每位客户展示

如果在浏览器中打开网站,您将获得一个可读的错误形式:

esaj.tjsp.jus.br uses an invalid security certificate. The certificate is not trusted because the issuer certificate is unknown. The server might not be sending the appropriate intermediate certificates. An additional root certificate may need to be imported. esaj.tjsp.jus.br使用了无效的安全证书。 证书不受信任,因为颁发者证书未知。 服务器可能未发送适当的中间证书。 可能需要导入其他根证书。 在浏览器中处理该错误时,可以查看有问题的证书以检查颁发者。它是:

CN = AC VALID BRASIL OU = Autoridade Certificadora VALID - AC VALID O = ICP-Brasil C = BR CN=AC有效巴西 OU=自动认证证书有效-AC有效 O=巴西ICP C=BR
如果您信任该机构,您需要获得其签名证书(而不是其网站的证书)才能验证网站。将其保存到文件中,并将选项
verify=/path/to/certfile
传递到
get()
。阅读完整段落:

问题不在于如何获得网站证书。该网站在每次握手时都会向每位客户展示

如果在浏览器中打开网站,您将获得一个可读的错误形式:

esaj.tjsp.jus.br uses an invalid security certificate. The certificate is not trusted because the issuer certificate is unknown. The server might not be sending the appropriate intermediate certificates. An additional root certificate may need to be imported. esaj.tjsp.jus.br使用了无效的安全证书。 证书不受信任,因为颁发者证书未知。 服务器可能未发送适当的中间证书。 可能需要导入其他根证书。 在浏览器中处理该错误时,可以查看有问题的证书以检查颁发者。它是:

CN = AC VALID BRASIL OU = Autoridade Certificadora VALID - AC VALID O = ICP-Brasil C = BR CN=AC有效巴西 OU=自动认证证书有效-AC有效 O=巴西ICP C=BR
如果您信任该机构,您需要获得其签名证书(而不是其网站的证书)才能验证网站。将其保存到文件中,并将选项
verify=/path/to/certfile
传递到
get()
。阅读完整段落:

尝试
请求。获取(url,verify=False)
谢谢。但这安全吗?“UnsecureRequestWarning”尝试
requests.get(url,verify=False)
谢谢。但这安全吗?“不安全的警告”非常感谢。但我如何才能看到签名证书?然后保存它?他们几乎肯定会在他们的网站上提供下载。但我不会说葡萄牙语,这是一个法院的网站。几乎不存在,但非常感谢你。但我如何才能看到签名证书?然后保存它?他们几乎肯定会在他们的网站上提供下载。但我不会说葡萄牙语,这是一个法院的网站。几乎不存在,但谢谢