I use regexr for making regular expression, but can't matching anything.
I wrote such regex '.dataLayer = (.+)</script>'
I have such structure of template:
<!DOCTYPE html>
<html lang="en-PH" dir="ltr">
<head> … </head>
<body class="is_full PdpV4">
<script> This one script which I should get </script>
<script> window.dataLayer = window.dataLayer || []; dataLayer.push({"feature_test":"VariableControl:1"}); dataLayer.push({"feature_set":"Control"});
</script>
<script>....</script>
<script> … </script>
</body>
</html>
And I need to get the first one script... /script
<script>
dataLayer = [
{
"agent_id": 558921,
"agent_name": "The City Townhouse",
"attributes": {
"agent_ratings_enabled": 0,
"approved": 1,
"attribute_set_id": 1,
"categories": JSON.parse("[15,19]"),
"indoor_features": ["Balcony","Maid's room"],
"is_agent": 1,
"listing_type": "Classifieds",
"other_features": [],
"outdoor_features": ["Garage"],
"price_formatted": "₱ 11,300,000 ",
"price_not_shown": false,
"seller_is_trusted": 1,
"show_listing_address": 1,
"show_mobile": 1
}
];
</script>
I need to get everything inside tags . Thanks a lot.