I am trying to extract inline javascript that is uniquely different across thousands of URLs and nested in code at different levels.
As I get to know the XPATH syntax, I'm trying to figure out if anyone knows a good way to configure javascript. For example:
<script type="text/javascript"> ...data_#...</script>
<script type="text/javascript"> ...data_#...</script>
<script type="text/javascript"> ...data_n...</script>
<script type="text/javascript"> ...data_#...</script>
<script type="text/javascript"> ...data_#...</script>
The only unique identifier inside <script>...data_n...</script>that I am trying to extract contains:
var tabsRelated = ...
Within XPATH, does anyone know a way to find a script that contains this variable and targets the whole script? Varieties like:
//script[inner.text contains='var tabsRelated'
Syntaxwrong
source
share