【发布时间】:2021-07-28 18:40:36
【问题描述】:
我有大约 500 个玩家链接。 除了两个之外,所有链接都返回响应代码 200。 但是,我需要具有代码 404 的确切链接/网址。
for p in range(len(playerLinks)):
page = playerLinks[p]
response = requests.get(page, headers={'User-Agent': 'Custom5'})
print(response.status_code)
injury = response.text
soup = BeautifulSoup(injury, 'html.parser')
table = soup.find(id="yw1")
非常感谢您的支持。 播放器链接的示例(这些链接的外观)是这样的(但至少有 500 种不同)
https://www.transfermarkt.de/Timothy Fosu-Mensah/verletzungen/spieler/315131']
【问题讨论】:
标签: python web-scraping http-status-code-404