【发布时间】:2013-03-16 22:32:21
【问题描述】:
可以用jsdom获取多行属性的值吗(我用的是Node.js+JQuery)?
要抓取的网站包含以下 HTML:
<li><a data-title="<strong>hello world
this is a test</strong>" href="example.org</strong>">A link</a></li>
不幸的是,这被解析为
<li><a data-title="data-title"><strong>hello world
this is a test</strong>' href="example.org">A link</a></li>
所以我无法提取标题和 href 属性,例如通过 JQuery:$("a").attr("data-title").
有什么想法吗?
【问题讨论】:
标签: javascript node.js web-scraping screen-scraping jsdom