score:0

Accepted answer
import React from "react";
import ReactDom from "react-dom";

class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      data: []
    };
  }

  componentDidMount() {
    fetch("url-to-scrape")
      .then(response => { //ReadableStream hiding response
        return response.text(); //Convert ReadableStream to text
      })
      .then(data => {
        var data_from_x = eval(data + "; x;"); //eval x and return it
        this.setState({data: data_from_x });
      })
  }
  

  render() {
    return (
      <div>
        <p>welcome to the app</p>
      </div>
    );
  }
}

ReactDom.render(<App />, document.getElementById("app"));

score:0

const response = 'var x = [["data","like", "this"],["and","like","this"]]'

const output = JSON.parse(response.substring(response.indexOf('=') + 1))

console.log(output)

Related Query

More Query from same tag