是否有可能通过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="
我看起来像当我通过jsdom运行页面时,页脚本中的$(document).ready块没有被执行。 下面是HTML: <html>
<body>
If everything works, you should see a message here: <h2 id="msg"></h2>
<script>
var checkpoint1 = true
va
更新: 我发现了,我没能在运行jQuery的网页所使用的标签“基地”如果网站包含标签jsdom是行不通的。虽然我不知道为什么。 <base href="http://bbs.18183.com/" />
为了验证这一点,我创建了一个全新的HTML文件,并把里面,然后jsdom失败。 我目前使用的是Node.js玩耍,读书How to Scrape Web Pages with Node.js
我从https://github.com/sylvinus/node-crawler var Crawler = require("crawler").Crawler;
var c = new Crawler({
"maxConnections":10,
"callback":function(error,result,$) {
console.log(resu