如何使用 ImportXML 公式或类似公式将 CSV 数据从网站导入 google 工作表?
How do you import CSV data from a website into google sheets using ImportXML formula or similar?
我之前使用 =IMPORTXML(J1,"//*[@id='afd-header-views-30d']")
从网站 socialblade.com 导入了数据。但是现在我想为过去一个月的浏览量导入一串数字,我不知道如何,这是网站源代码的样子:
<div id="AverageViewsPerMonth" style = "width: 860px; height: 160px; padding-top: 10px;"></div>
<script type="text/javascript">
g = new Dygraph(
// containing div
document.getElementById('AverageViewsPerMonth'),
// CSV or path to a CSV file.
"Date,Monthly Views\n" + "2016-10-1,6338035\n" + "2016-11-1,3005749\n" + "2016-12-1,2951816\n" + "2017-01-1,3185303\n" + "2017-02-1,3849745\n" + , {
title: 'Total Views Per Month for Peaceful Cuisine ',
这是一个任何人都可以编辑的 Google 电子表格:
https://docs.google.com/spreadsheets/d/1DjZbiUy6P2L2i2INoN1c0tAZsAeCBmM3-PSXp9E0JFw/edit?usp=sharing
如果有人能告诉我如何使用像这样的 socialblade link 示例,我将不胜感激:
JavaScript 个元素不可能被 Google 个 Sheets
抓取
=REGEXEXTRACT(TEXTJOIN(, 1, QUERY(ARRAY_CONSTRAIN(IMPORTDATA(
"https://socialblade.com/youtube/user/ryoya1983/monthly"), 5000, 3),
"where Col1 contains 'color:#41a200' and Col3 is not null", 0)), "\+(.+?)\<")
我之前使用 =IMPORTXML(J1,"//*[@id='afd-header-views-30d']")
从网站 socialblade.com 导入了数据。但是现在我想为过去一个月的浏览量导入一串数字,我不知道如何,这是网站源代码的样子:
<div id="AverageViewsPerMonth" style = "width: 860px; height: 160px; padding-top: 10px;"></div>
<script type="text/javascript">
g = new Dygraph(
// containing div
document.getElementById('AverageViewsPerMonth'),
// CSV or path to a CSV file.
"Date,Monthly Views\n" + "2016-10-1,6338035\n" + "2016-11-1,3005749\n" + "2016-12-1,2951816\n" + "2017-01-1,3185303\n" + "2017-02-1,3849745\n" + , {
title: 'Total Views Per Month for Peaceful Cuisine ',
这是一个任何人都可以编辑的 Google 电子表格:
https://docs.google.com/spreadsheets/d/1DjZbiUy6P2L2i2INoN1c0tAZsAeCBmM3-PSXp9E0JFw/edit?usp=sharing
如果有人能告诉我如何使用像这样的 socialblade link 示例,我将不胜感激:
JavaScript 个元素不可能被 Google 个 Sheets
抓取=REGEXEXTRACT(TEXTJOIN(, 1, QUERY(ARRAY_CONSTRAIN(IMPORTDATA(
"https://socialblade.com/youtube/user/ryoya1983/monthly"), 5000, 3),
"where Col1 contains 'color:#41a200' and Col3 is not null", 0)), "\+(.+?)\<")