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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -