gpt4 book ai didi

Import.io 简单脚本 javascript

转载 作者:行者123 更新时间:2023-12-02 04:49:48 24 4
gpt4 key购买 nike

我正在尝试将简单的 import.io 与 JavaScript(示例网站)结合使用,但脚本无法正常工作。你能帮帮我吗?

  <!DOCTYPE html>   <html> <head>   <title>Import&bull;io
Example</title> <script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<!-- 1. Include the client library --> <script
src="https://cdn.import.io/js/2.0.0/importio.js"></script>

<!-- 2. Configure the library --> <script type="text/javascript">
importio.init({
"auth": {
"userGuid": "XXX",
"apiKey": "XXX"
},
"host": "import.io"
});

// Data and done callbacks
var dataCallback = function(data) {
console.log("Data received", data);
for (var i = 0; i < data.length; i++) {
var d = data[i]; for (var k in d.data) {
document.write("<i>" + k + "</i>: " + d.data[k] + "<br />"); } document.write("<hr>"); }
}
var doneCallback = function(data) {
console.log("Done, all data:", data);
document.write("<b>Done</b><hr>");
}

// 3. Do the query (when the function is called)
var doQuery = function() {
// Query for tile Magic Api
importio.query({
"connectorGuids": [
"a362c175-e265-4f96-867c-5610686bbb21"
],
"input": {
"webpage/url": "http://www.davy.ie/markets-and-share-prices/iseq"
}
}, { "data": dataCallback, "done": doneCallback });
} </script> <body>
<button onclick="doQuery()">Query</button> </body> </html>

最佳答案

import.io 转向交互提取器之前我总是使用 User JavaScript and CSS 在所需网站上进行本地测试 Chrome 扩展。

也许这可以帮助你。

关于Import.io 简单脚本 javascript,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29846832/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com