Excel calls Youdao Dictionary to achieve batch translation

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)

  1. Parameter ①Xml is a string in valid XML format;
  2. 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

Guess you like

Origin blog.csdn.net/qq_19446965/article/details/121725427