不允许第一个方法 API
Method not allowed first API
已经浏览了一些 Web scraping 教程,现在正在尝试基本的 api 抓取工具。
这是我的代码
from bs4 import BeautifulSoup
import requests
url = 'https://qships.tmr.qld.gov.au/webx/services/wxdata.svc/GetDataX'
response = requests.get(url, timeout=5)
content = BeautifulSoup(response.content, "html.parser")
print (content)
提出不允许的方法:(
我还在学习所以任何建议都会被很好地接受
干杯
这显然是您的 URL 的问题,服务不允许检索信息。但您可以查看此 URL,其中描述了检索元数据的步骤。
https://qships.tmr.qld.gov.au/webx/services/wxdata.svc
已经浏览了一些 Web scraping 教程,现在正在尝试基本的 api 抓取工具。
这是我的代码
from bs4 import BeautifulSoup
import requests
url = 'https://qships.tmr.qld.gov.au/webx/services/wxdata.svc/GetDataX'
response = requests.get(url, timeout=5)
content = BeautifulSoup(response.content, "html.parser")
print (content)
提出不允许的方法:(
我还在学习所以任何建议都会被很好地接受 干杯
这显然是您的 URL 的问题,服务不允许检索信息。但您可以查看此 URL,其中描述了检索元数据的步骤。 https://qships.tmr.qld.gov.au/webx/services/wxdata.svc