As shown in the figure, we write the formula in cell B2:
=FILTERXML(WEBSERVICE("http://fanyi.youdao.com/translate?&i="&A2&"&doctype=xml&version"),"//translation")
Then fill down to translate the text in column A into English.
Remember to replace A2 with your own. . .
Principle: FILTERXML function
Here we use the network class function FILTERXML in Excel, which is a new function after Excel2013, which can obtain the information under the specified path in the XML structured content.
The syntax of the function is: FILTERXML(xml, xpath)
- Parameter ①Xml is a string in valid XML format;
- Parameter ②Xpath is a standard XPath format string (that is, the standard path of the target data in XML)
Reference: https://www.cnblogs.com/bonelee/p/15633954.html