如何提取如下所示的内联javascripts:
<script type="text/javascript">...fetch-me...</script>
<script type="application/javascript">...fetch-me...</script>
<script>...fetch-me...</script>
但要避免匹配非JavaScript和外部资源:
<script type="text/javascript" src="file.js"></script>
<script type="application/javascript" src="file.js"></script>
<script src="file.js"></script>
<script type="application/ld+json">...</script>
这对我来说不起作用:
#<script(?:[^>]*\stype="(?:application|text)/javascript")?[^>]*>(.*?)</script>#isg