通过 Power BI Desktop 连接到网页Connect to a web page from Power BI Desktop

用户可以连接到网页,然后将其数据导入到 Power BI Desktop 并在视觉对象和数据模型中使用该数据。You can connect to a web page, and import its data into Power BI Desktop, to use in your visuals and in your data models.

在 Power BI Desktop 中,从“开始”功能区选择“获取数据”>“Web”。In Power BI Desktop, select Get Data > Web from the Home ribbon.

此时将出现一个对话框,要求提供想要从中导入数据的网页的 URL。A dialog appears, asking for the URL of the web page from which you want to import data.

键入(或粘贴)该 URL 后,请选择“确定”。Once you’ve typed in (or pasted) the URL, select OK. Power BI Desktop 将连接到该页面,然后在“导航器”窗口显示页面的可用数据。Power BI Desktop connects to that page, then presents the page’s available data in the Navigator window. 当你选择了其中一个可用的数据元素(如整页的表)后,“导航器”窗口将在右侧显示该数据的预览。When you select one of the available data elements, such as a table of the entire page, the Navigator window displays a preview of that data on the right side of the window.

你可以选择“编辑”按钮,启动“编辑查询器”,在其中你可以在将数据导入 Power BI Desktop 前在网页上调整和转换该数据。You can choose the Edit button, which launches Query Editor, where you can shape and transform the data on that Web page before importing it into Power BI Desktop. 或者也可以选择“加载”按钮,然后导入左窗格中所有选定的数据元素。Or you can select the Load button, and import all of the data elements you selected in the left pane.

当我们选择“加载”时,Power BI Desktop 将导入所选项目,并使其在 Power BI Desktop 中的报表视图右侧的“字段”窗格中可用。When we select Load, Power BI Desktop imports the selected items, and makes them available in the Fields pane, found on the right side of the Reports view in Power BI Desktop.

连接到网页并将其数据导入 Power BI Desktop 的步骤就是这些。That’s all there is to connecting to a web page and bringing its data into Power BI Desktop.

接下来,你可以将这些字段拖到报表画布并创建所有想要的可视化效果。From there, you can drag those fields onto the Report canvas and create all the visualizations you want. 你还可以同处理其他所有数据一样处理来自该网页的数据,例如调整该数据、在它与模型中其他数据源之间创建关系以及进行一切所需操作来创建你想要的 Power BI 报表。You can also work this the data from that Web page just like you would any other data – you can shape it, you can create relationships between it and other data sources in your model, and otherwise do what you’d like to create just the Power BI report you want.

若要更深入地了解连接到网页,请查看 Power BI Desktop 入门指南To see connecting to a Web page in more depth and action, take a look at the Power BI Desktop Getting Started Guide.

后续步骤Next steps

你可以使用 Power BI Desktop 连接到各种数据。There are all sorts of data you can connect to using Power BI Desktop. 有关数据源的详细信息,请参阅下列资源:For more information on data sources, check out the following resources: