【发布时间】:2020-11-21 11:49:26
【问题描述】:
我想通过 python3 请求this。
这是代码:
import requests
bizportal_company_url = "https://www.bizportal.co.il/realestates/quote/generalview/373019"
self.page = requests.get(self.bizportal_company_url)
我得到:
<Response [403]>
当我将 verify=False 添加到 get 命令时,我得到:
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecureRequestWarning)
<Response [403]>
我该如何解决?当我访问网址时,没有密码或任何东西。
【问题讨论】:
-
您确定该网站在网络浏览器中打开吗?
-
@Ava 我可以,是的。为什么,你不能?
-
不,我不能。 :) 至少与代码中的链接无关。
-
在获取内容时尝试添加适当的 http 标头。
-
什么意思?
标签: python-3.x web-scraping python-requests google-colaboratory