【问题标题】:Why am I getting this ERRNO 110 - python requests为什么我得到这个 ERRNO 110 - python 请求
【发布时间】:2018-09-24 18:06:07
【问题描述】:

我想知道当我尝试向这个 URL 发出请求时出现了什么问题。这是我的代码:

import requests as rq
from bs4 import BeautifulSoup

def make_request(Url):
    result = rq.get(Url)
    soup = BeautifulSoup(result.content, "html.parser")
    events = soup.find_all("a")
    for i in events:
        print(i)
make_request("https://web.archive.org/web/20180507100019/https://bravenewcoin.com/industry-resources/events-calendar/bitcoin-and-blockchain-events/")

我认为问题在于 URL,在这种情况下,我能做些什么来解决这个问题并解析该网站的内容?非常感谢!

【问题讨论】:

  • 我无法复制错误,它对我来说打印得很好
  • herehere。问题似乎出在你身上
  • @roganjosh 真的吗?也许这是我的设置。
  • 你的网址有问题,有两个 https://!!
  • @stovfl 我已经尝试不使用第二个 https 但仍然无法正常工作

标签: python beautifulsoup python-requests


【解决方案1】:

你的函数中有两个url,

https://web.archive.org/web/20180507100019/
https://bravenewcoin.com/industry-resources/events-calendar/bitcoin-and-blockchain-events/

请一次提供一个网址。

【讨论】:

    【解决方案2】:

    你可以请求两个网址一次。你似乎需要这个

    urls = [
    "https://web.archive.org/web/20180507100019/",
    "https://bravenewcoin.com/industry-resources/events-calendar/bitcoin-and-blockchain-events/"]
    for url in urls:
        make_request(url)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-09
      • 2023-01-12
      • 2021-12-04
      • 1970-01-01
      • 2018-08-08
      • 1970-01-01
      相关资源
      最近更新 更多