作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试访问试图阻止抓取工具的页面上的一些数据。
根据我收集的信息,该页面的行为如下:
1.) 骨架页面加载2.) 一旦完成,就会有一些 JavaScript 访问数据 blob,然后用适当的内容填充页面
我尝试访问的数据如下所示
<code id="templates/desktop/profile/profile_streaming..."><!--{"data":{"breadcrumbs": ...this is where the data is... }}--></code>
以及运行的脚本:
<script>if (!fs.isUniEscapeOn()) { fs.setUniEscape(true); }fs.embed('templates/desktop/profile/profile_streaming...','templates/desktop/profile/profile_streaming',undefined,'stream-container');</script>
但是,当我尝试像 $('code')
这样的 jQuery 选择器时或$('code[id*="templates]')
他们都找不到该元素。
页面是否可以从 jQuery 选择器中隐藏元素?
有关如何访问 <code >
内的数据的任何想法标签?
最佳答案
如果<code> </code>
的内容只是评论,
$('code').contents()[0].data
将从那里提取评论。如果内容有 JSON 可以使用 JSON.parse
从由此获得的对象中获取您感兴趣的领域。
关于javascript - jQuery:搜索已在 HTML 中注释掉的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46006448/
我正在编写一个快速的 preg_replace 来从 CSS 中删除注释。 CSS 注释通常有这样的语法: /* Development Classes*/ /* Un-comment me for
使用 MySQL,我有三个表: 项目: ID name 1 "birthday party" 2 "soccer match" 3 "wine tasting evening" 4
我是一名优秀的程序员,十分优秀!