feichao93 / temme Goto Github PK
View Code? Open in Web Editor NEW📄 Concise selector to extract JSON from HTML.
Home Page: https://temme.js.org
License: MIT License
📄 Concise selector to extract JSON from HTML.
Home Page: https://temme.js.org
License: MIT License
It would be great if we could use Lodash functions as filters rather than (or in addition to) the current builtins, which are a useful but limited subset of the functionality available in Lodash.
I realise they can be added when using temme as a library, but that doesn't help with the CLI tool and requires anyone who wants to add those filters to write their own CLI frontend.
Several CLI tools use Lodash to enhance and extend the standard library e.g.:
因为间接引用了 flatmap-stream,需要更新依赖之后发布新版本。 相关新闻: https://zhuanlan.zhihu.com/p/50938220
新版网站 https://temmejs.org 目前处于 beta 版本,欢迎大家进行体验。在新版网站正式发布之前,仍需要完成下列工作。
一些可选完成的工作:
开发和打包的脚本完善:
jest
来自动化测试, 使用fs
来载入语法; 直接使用源代码进行测试yarn run build
时, 使用webpack pegjs-loader来载入语法yarn run build-playground
来编译playground:
to |
:root
, :first-child
$foo|split(',')|slice(0, 10)
.$a = 'abc'
.;
to be selector seprator.()
to {}
.*
.>
, +
and ~
.=
, ~=
, |=
, *=
, ^=
, $=
.感谢作者提供了这么有趣 & 好用的功能。
我在把之前 cheerio 写的逻辑改成 temme 文件时,遇到了这么一个问题:
let title = $el.find('.res-title').text() || $el.find('.mh-title').text() || $el.find('.os-title').text() || 'no title';
我的 title 需要从三个元素中查找,以第一个非空值为准,如果都找不到就用默认值。以 temme 现有的功能,目前不太好实现。
请作者帮忙看下。
||
require
&
相关语法错误已移除:在线版本中使用 VSCode 编辑器(Monaco Editor)
原因:Monaco 编辑器无法使用 textmate 语法
已移除:在解析结果中提供符号位置
原因:嫌麻烦
To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:
.travis.yml
package.json
files, so that was left aloneIf you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.
Greenkeeper has checked the engines
key in any package.json
file, the .nvmrc
file, and the .travis.yml
file, if present.
engines
was only updated if it defined a single version, not a range..nvmrc
was updated to Node.js 10.travis.yml
was only changed if there was a root-level node_js
that didn’t already include Node.js 10, such as node
or lts/*
. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.For many simpler .travis.yml
configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
v0.8 将带来若干更新,主要包括 modifier 机制和 CaptureResult 的简化。下面是距离发布 v0.8 仍要完成的工作列表:
temme
函数参数更新关于:first-child无法使用 希望可以得到一个解决方案 例如出现
<div class="left">
<h3>北京市</h3>
<p>已接入<em class="data-margin-s">23</em>家</p>
<p>未接入<em class="data-margin-s">0</em>家</p>
<p>累计直播<em class="data-margin-b">1449</em>件</p>
</div>
需要得到已接入量
和未接入量
Implemented 4fc9113
类似于:
form .mainbox.viewthread@list{
.postauthor@@author{
cite a[id^=userinfo]{$name};
p:nth-of-type(1){$level};
}
.postcontent{$content|html}
}
output:
[
{
author: { name: "111", level: "222" },
content: "fdjsfkfdf"
}
]
Please allow spaces to be used around the pipe operator (|
). They make filters much easier to read.
Before:
div.movies@ {
.title { $title };
.date { $date };
.duration { $duration|match("\\d+")|get(0)|Number };
}
After:
div.movies@ {
.title { $title };
.date { $date };
.duration { $duration | match("\\d+") | get(0) | Number };
}
你好,如果有一个类似如这样的html片段,内容不同,如何抓取这个list呢
能提供一下思路吗,感谢(・ω・)ノ
<li class="t"><p>2132</p></li>
<li class="t"><p>2132</p></li>
<li class="p"><img></img></li>
<li class="f"><h2><h2><p></p></li>
1.15.2
to 1.15.3
.This version is covered by your current version range and after updating it in your project the build failed.
prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot 🌴
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.