Extracting script tags from webpage using user script

Posted by user1275375 on Stack Overflow See other posts from Stack Overflow or by user1275375
Published on 2012-04-03T11:25:17Z Indexed on 2012/04/03 11:29 UTC
Read the original article Hit count: 212

Filed under:
|
|

My userscript has the following code

var scrpt=document.getElementsByTagName('script');

i included this to know the number of scripts of each page i access.

This works fine with some websites but for some sites i am not getting all the scripts present. I installed the user script in both firefox and chrome the issue is the number of scripts for the same site is different in both browsers.

For example when i access this link Help extracting text from html tag with Java and Regex

i am getting the number of scripts in firefox as:17 and in chrome as:15

but when i view the page source there are 22 script tags

Please help me to slove the problem. I even tried document.scripts but still i get the same result.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about dom