【发布时间】:2013-01-10 01:34:58
【问题描述】:
我想得到主机的标题页
我希望得到 Страховые компании Уфы。 Адреса отделений в Уфе
然后得到 ��������������������. ���������������� �����
示例脚本:
function doGet() {
var options1 = {
contentType: "text/html; charset=windows-1251",
muteHttpExceptions: true
};
var url_catalog = 'http://ufa.insure-company.ru/';
var response = UrlFetchApp.fetch(url_catalog, options1);
var txt = response.getContentText();
doc = Xml.parse(txt, true);
var tbody = doc.html.head;
var title = tbody.getElements("title");
var t = title[0].getText();
return HtmlService.createHtmlOutput(t);
}
【问题讨论】: