javascript - How to extract a JS variable using scan or match function in ruby? -
i content (source) of webpage using faraday in ruby. want extract js variable in source code obtained faraday. js variable written :
argtab["labelexample"] = "thethingiwant";
i want in ruby (framework rails).
how this:
/\w+\[\"\w+\"\]\s\=\s\"(\w+)\"\;/.match(f)[1]
where f
source string? it's important note escapes double quotes, improved allow single or double quotes.
Comments
Post a Comment